Given an integer array nums, return a new array containing the elements of nums in reverse order. You must implement the reversal recursively without using any loops.
Input: An integer array nums.
Output: Return the reversed array as a comma-separated list inside square brackets, e.g. [3,2,1].
Input: [1,2,3,4,5]
Output: [5,4,3,2,1]
Explanation: Swap pairs from outside in: (1,5), (2,4); 3 stays.Input: [7]
Output: [7]
Explanation: Single element is its own reverse.Input: [1,2]
Output: [2,1]
Explanation: Two elements swap.1 <= nums.length <= 10^4-10^9 <= nums[i] <= 10^9