二维数组的排序
Arrays.sort(pairs, (p1, p2) -> (p1[1] - p2[1]));
class Solution {
public int findLongestChain(int[][] pairs) {int re=0,form=Integer.MIN_VALUE;
Arrays.sort(pairs, (p1, p2) -> (p1[1] - p2[1]));
for(int i=0;i<pairs.length;i++){
if(pairs[i][0]>form){
form=pairs[i][1];
re++;
}
}
return re;
}
}