Given an integer array nums and an integer target, return an array containing ALL indices at which target appears in nums, in increasing order. If target does not appear, return an empty array. You must collect the indices recursively, without using a loop.
Input: An integer array nums and an integer target.
Output: Return an array of indices as [i1,i2,...] (or [] if none).
Input: [1,2,3,2,1], 2
Output: [1,3]
Explanation: 2 occurs at indices 1 and 3.Input: [5,5,5,5], 5
Output: [0,1,2,3]
Explanation: Every position matches.Input: [1,2,3], 4
Output: []
Explanation: 4 never appears.1 <= nums.length <= 10^4-10^9 <= nums[i] <= 10^9