Leetcode Reverse An Array Using Functions