Leetcode Coding Exercise On Numpy Python