1014. Best Sightseeing Pair - Explanation

Problem Link