Reverse Array Problem Leetcode Solutions Java