Array Based Leetcode Problems Python