摘要:
这题做了一个time limit exceeded public int[] sortArrayByParityII(int[] A) { LinkedList<Integer> list = new LinkedList<Integer>(); for (int i = 0; i < A.leng 阅读全文
摘要:
public int heightChecker(int[] heights) { int [] Heights=heights.clone(); int count=0; //标记有几个不同 Arrays.sort(heights); for(int i=0;i<heights.length;i+ 阅读全文
摘要:
public int[] sortArrayByParity(int[] A) { LinkedList<Integer> list = new LinkedList<Integer>(); for (int i = 0; i < A.length; i++) { if (A[i] % 2 == 0 阅读全文
摘要:
public int[] replaceElements(int[] arr) { for(int i=0;i<arr.length-1;i++) arr[i]=findRightmax(i,arr); arr[arr.length-1]=-1; return arr; } public int f 阅读全文
摘要:
public int oddCells(int n, int m, int[][] indices) { int[][] Array = new int[n][m]; int rowlength = indices.length; //求出indices数组行数 for (int i = 0; i 阅读全文