# Leetcode 1929. Concatenation of Array

# **Intuition**

Loop through input array and fill answer array in one pass.

# **Approach**

In one forloop set the ans\[i\] and ans\[i + nums.Length\]  
to the current value at nums\[i\].

# **Code**

```csharp
public class Solution 
{
    public int[] GetConcatenation(int[] nums) 
    {
        var numsLength = nums.Length;
        var ansLength = numsLength * 2;
        int[] ans = new int[ansLength];

        for(int i = 0; i < numsLength; i++)
        {
           ans[i] = nums[i];
           ans[i + numsLength] = nums[i];
        }
        
        return ans;
    }
}
```
