sort操作


sort比较多维vector

1
2
3
sort(intervals.begin(),intervals.end(),[](vector<int> &a,vector<int> &b){
return a[1]<b[1];
});
1
2
3
Arrays.sort(ins, (a, b)->{
return a[1] != b[1] ? a[1] - b[1] : b[0] - a[0];
});

Author: pkq
Reprint policy: All articles in this blog are used except for special statements CC BY 4.0 reprint policy. If reproduced, please indicate source pkq !
  TOC