File tree 3 files changed +37
-0
lines changed
solution/1900-1999/1929.Concatenation of Array
3 files changed +37
-0
lines changed Original file line number Diff line number Diff line change @@ -82,6 +82,20 @@ class Solution {
82
82
}
83
83
```
84
84
85
+ ### ** JavaScript**
86
+
87
+ ``` js
88
+ /**
89
+ * @param {number[]} nums
90
+ * @return {number[]}
91
+ */
92
+ var getConcatenation = function (nums ) {
93
+ let ans = nums .slice ();
94
+ ans .splice (nums .length , 0 , ... nums);
95
+ return ans;
96
+ };
97
+ ```
98
+
85
99
### ** C++**
86
100
87
101
``` cpp
Original file line number Diff line number Diff line change @@ -67,6 +67,20 @@ class Solution {
67
67
}
68
68
```
69
69
70
+ ### ** JavaScript**
71
+
72
+ ``` js
73
+ /**
74
+ * @param {number[]} nums
75
+ * @return {number[]}
76
+ */
77
+ var getConcatenation = function (nums ) {
78
+ let ans = nums .slice ();
79
+ ans .splice (nums .length , 0 , ... nums);
80
+ return ans;
81
+ };
82
+ ```
83
+
70
84
### ** C++**
71
85
72
86
``` cpp
Original file line number Diff line number Diff line change
1
+ /**
2
+ * @param {number[] } nums
3
+ * @return {number[] }
4
+ */
5
+ var getConcatenation = function ( nums ) {
6
+ let ans = nums . slice ( ) ;
7
+ ans . splice ( nums . length , 0 , ...nums ) ;
8
+ return ans ;
9
+ } ;
You can’t perform that action at this time.
0 commit comments