We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b4f29aa commit a6aa970Copy full SHA for a6aa970
1 file changed
src/arrays/Problem1929.java
@@ -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