Array Related Problems In Leetcode Two