I have an ArrayList of ints[] that I would like to sort based on the distance from a specific position.
Example. ArrayList<int[]> = {-2,-3},{2,3}, {1,2}
Specific position = {1,1}
After sorting: {1,2}, {2,3}, {-2,-3}
I know I can just subtract {1,1} from every int[] then create a Comparator for the magnitudes--but my question specifically is how to do it without subtracting {1,1} first.