Reverse Sub Array Leetcode Question