LeetCode
Best Sightseeing Pair
Click
here
for an explanation.