Skip to content

Commit a6aa970

Browse files
author
oleg.vlasov
committed
problem1929
1 parent b4f29aa commit a6aa970

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

src/arrays/Problem1929.java

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
package src.arrays;
2+
3+
public class Problem1929 {
4+
//https://leetcode.com/problems/concatenation-of-array/description/
5+
public static void main(final String[] args) {
6+
final int[] nums = new int[]{1, 2, 1};
7+
}
8+
9+
public static int[] getConcatenation(final int[] nums) {
10+
final int lenght = nums.length;
11+
final int[] ans = new int[lenght * 2];
12+
if (1 <= lenght && lenght < 1000) {
13+
for (int i = 0; i < nums.length; i++) {
14+
if (1 <= nums[i] && nums[i] <= 1000) {
15+
ans[i] = nums[i];
16+
ans[i + lenght] = nums[i];
17+
}
18+
}
19+
}
20+
return ans;
21+
}
22+
}

0 commit comments

Comments
 (0)