Max Min Problem Leetcode Playground Python