Easy Approach and Fastest Solution
Please Upvote my solution, if you find it helpful ;)\n\n# Intuition\nThis code creates a new array by concatenating the input array with itself. It iterates thr
## ***Please Upvote my solution, if you find it helpful ;)***\n\n# Intuition\nThis code creates a new array by concatenating the input array with itself. It iterates through the elements of the input array and assigns each element to the corresponding positions in the new array. Finally, it returns the resulting array. The time complexity is linear, and the space complexity is also linear.\n\n# Code\n\n```java []\nclass Solution {\n    public int[] getConcatenation(int[] nums) {\n        // Create a new array to store the concatenated list\n        int[] answer = new int[2 * nums.length];\n        int j = 0;\n\n        // Iterate through the original list\n        for (int i = 0; i < nums.length; i++) {\n            // Add the current number to the new list\n            answer[i] = nums[i];\n            // Add the current number again at the corresponding position after the original numbers\n            answer[i + nums.length] = nums[i];\n        }\n\n        // Return the concatenated list\n        return answer;\n    }\n}\n\n```\n```python []\nclass Solution(object):\n    def getConcatenation(self, nums):\n        # Create a new list to store the concatenated list\n        answer = [0] * (2 * len(nums))\n        j = 0\n\n        # Iterate through the original list\n        for i in range(len(nums)):\n            # Add the current number to the new list\n            answer[i] = nums[i]\n            # Add the current number again at the corresponding position after the original numbers\n            answer[i + len(nums)] = nums[i]\n\n        # Return the concatenated list\n        return answer\n\n\n```\n```C++ []\nclass Solution {\npublic:\n    std::vector<int> getConcatenation(std::vector<int>& nums) {\n        // Create a new vector to store the concatenated vector\n        std::vector<int> answer(2 * nums.size());\n        int j = 0;\n\n        // Iterate through the original vector\n        for (int i = 0; i < nums.size(); i++) {\n            // Add the current number to the new vector\n            answer[i] = nums[i];\n            // Add the current number again at the corresponding position after the original numbers\n            answer[i + nums.size()] = nums[i];\n        }\n\n        // Return the concatenated vector\n        return answer;\n    }\n};\n```\n# Complexity\n- Time complexity:\nThe time complexity of your solution is $$O(n)$$, where n is the length of the input array nums. This is because you iterate through the nums array once to assign elements to the answer array.\n\n- Space complexity:\nThe space complexity of your solution is $$O(n)$$, where n is the length of the input array nums. This is because you create a new array answer with a length of 2n to store the concatenated elements.\n\n## ***Please Upvote my solution, if you find it helpful ;)***\n\n![6a87bc25-d70b-424f-9e60-7da6f345b82a_1673875931.8933976.jpeg](https://assets.leetcode.com/users/images/e1222b68-0d03-4bea-b7f6-5333eee69806_1687883364.7177477.jpeg)\n\n
['Array', 'Python', 'C++', 'Java']