You are given a set of points on the Cartesian plane. Consider the distance between two points as the maximum difference of their coordinates. For example, the distance between points (1, 2) and (4, 6) is equal to max(|4 - 1|, |6 - 2|) = 4.
Given a set of points, find the pair with the largest distance and return the value of their distance.
Example
For A = [7, 6, 6, 8, 1, 2, 8, 6], the output should be
largestDistance(A) = 7.