Leetcode Problem On Array Definition In Python