I am in a situation where I need to find the maximum LatLng in a pool of LatLngs.
For example: Imagine I have the following
LatLng(3.9,3.4);
LatLng(1.2,3.3);
LatLng(0.4,2.4);
Clearly from the above, I think the first LatLng
pair is the farthest and biggest, but how can I determine this algorithmically is the problem I have.
For example, in a regular array of integers say let a = [1,3,5,6]
;
let max = Math.max(a); //This would be 6.
But how can this be determined when working with pairs instead.
Any insight would be really appreciated.