Concatenation of Array LeetCode solution in Java

1
class Solution {
2
public int[] getConcatenation(int[] nums) {
3
int[] ans = new int[2 * nums.length];
4
for (int i = 0; i < nums.length; i++) {
5
ans[i] = ans[i + nums.length] = nums[i];
6
}
7

8
return ans;
9
}
10
}

0

WPM •0 •0

100%

ACC •0 •0

0s

TIME •0