nums = IntStream.of(nums) .boxed() .sorted((o1, o2) -> Math.abs(o2) - Math.abs(o1)) .mapToInt(Integer::intValue).toArray();
上面那种方法, [[-2147483646,-2147483645],[2147483646,2147483647]] 排这种的时候会溢出
所以最好比较大小,不要用减法!!!!!!!!
Arrays.sort(points, new Comparator() { @Override public int compare(int[] t1, int[] t2) { if(t1[0]==t2[0]){ if(t1[1]>t2[1]) return 1; else if(t1[1]==t2[1]) return 0; else return -1; } if(t1[0]>t2[0]) return 1; else return -1; } });



