Hi, part of the solution in the Silver Problem “Rental Service” includes the following sorting algorithm that I didn’t really understand.
public static void sort(int[] l) {
Arrays.sort(l);
for(int i = 0; i < l.length-1-i; i++) {
l[i] ^= l[l.length-1-i];
l[l.length-1-i] ^= l[i];
l[i] ^= l[l.length-1-i];
}
}
Could someone help me make sense of what this does and/or how it works?