Array Based Leetcode Problems On Loops In Python