Arrays.sort(courses, (a, b) -> a[1] - b[1]);
PriorityQueue<Integer> queue = new PriorityQueue<>((a, b) -> b - a);
I tried looking at the docs but cannot understand what the second argument is responsible for. I know that .sort(array, 1, 4) means sort from index 1 to 3. But in this case, the arrow with -> a[1] - b[1]
and ((a, b) -> b - a)
is what I am unable to understand.