Blazing Fast! ⚡ 0ms Java Solution | Beats 100% | Simple & Clean
IntuitionThe problem requires us to create a new array that consists of the given array twice in order. My first thought was to create a new array with double t
# Intuition
The problem requires us to create a new array that consists of the given array twice in order. My first thought was to create a new array with double the size of the original one and then copy the original array twice into it.

# Approach
Create a new array of size 2 * nums.length.
Use System.arraycopy() to copy the original array into the first half of the new array.
Again, use System.arraycopy() to copy the original array into the second half of the new array.
Return the new array.

# Complexity
- Time complexity:
- 𝑂(n),because we are copying the array twice, which takes linear time.

- Space complexity:
O(n) since we are creating a new array of twice the size of the original.

# Code
```java []
class Solution {
    public int[] getConcatenation(int[] nums) {
        int array[]=new int[2*nums.length];
        System.arraycopy(nums,0,array,0,nums.length);
        System.arraycopy(nums,0,array,nums.length,nums.length);
        return array;
    }
} 
```
['Java']