对牛可弹琴
对牛可弹琴
全部文章
分类
题解(36)
归档
标签
去牛客网
登录
/
注册
对牛可弹琴的博客
全部文章
(共6篇)
题解 | #商品交易(网易校招笔试真题)#
```public class Solution { public int FirstNotRepeatingChar(String str) { if (str.length() == 0) { return -1; } ...
Java
2022-02-21
0
244
题解 | #商品交易(网易校招笔试真题)#
```public class Solution { public int GetNumberOfK(int [] array , int k) { // 排除数组是空的情况 if (array.length == 0) { retu...
Java
2022-02-21
0
234
题解 | #商品交易(网易校招笔试真题)#
```import java.util.Arrays; public class Solution { public int MoreThanHalfNum_Solution(int [] array) { if (array.length==1){ ...
Mysql
Java
2022-02-21
0
278
题解 | #商品交易(网易校招笔试真题)#
```import java.util.ArrayList; import java.util.List; public class Solution { public int[] multiply(int[] A) { // 初始化B int[] B ...
Java
2022-02-21
0
249
题解 | #替换空格#
替换不可变字符串空格: 借助一个可变字符串,遍历原字符串如若是原字符进行追加,空格则替换为%20再追加。 public String replaceSpace(String s) { // write code here int length = s.leng...
Java
字符串
2021-12-24
0
350
题解 | #数组中出现次数超过一半的数字#
取数组长度超过一半的数字,即取中间位置的数字。排序数组,返回中间位数字。另外需排除数组长度为1的情况。 public int MoreThanHalfNum_Solution(int [] array) { // 排序数组 // Arrays.sort(array); if (array.lengt...
Java
数组
2021-12-24
0
240