Leetcode Problem On Array Methods