Leetcode Array And Arraylist In Python