Reverse Array Problem Leetcode 1501