Reverse Array Problem Leetcode Contest Solution