array and hashmap
May 6, 2023
Concatenation of array
We can just merge the array with itself and return.
class Solution:
def getConcatenation(self, nums: List[int]) -> List[int]:
return nums + nums
Time complexity: O(n)
Space complexity: O(1)