1929. Concatenation of Array

Practice Concatenation of Array for free on NudgeCode: Easy, Array & Hash Table pattern. Write it in Python or JavaScript, run the tests in your browser, and ask for a hint when you are stuck.

Return an array ans of length 2n that is nums followed by another copy of nums, so ans[i] == nums[i] and ans[i + n] == nums[i].

Example

nums = [1,2,1]  ->  [1,2,1,1,2,1]

Constraints