Reverse Array Problem Leetcode Java