Maximum Length of Pair Chain - Leetcode 646 - Python