Skip to content

Latest commit

 

History

History
10 lines (9 loc) · 297 Bytes

File metadata and controls

10 lines (9 loc) · 297 Bytes

To sort the array or similae data structure we can use Comparator to sort the data how we want

Arrays.sort(intervals, new Comparator<int[]>(){
            @Override
            public int compare(int[] a,int[] b){
                return Integer.compare(a[0],b[0]);
            }
});