Skip to content

Commit 988b0c8

Browse files
authored
feat: add js solution to lc problem: No.1929.Concatenation of Array (#509)
1 parent 830c662 commit 988b0c8

File tree

3 files changed

+37
-0
lines changed

3 files changed

+37
-0
lines changed

solution/1900-1999/1929.Concatenation of Array/README.md

+14
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,20 @@ class Solution {
8282
}
8383
```
8484

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+
8599
### **C++**
86100

87101
```cpp

solution/1900-1999/1929.Concatenation of Array/README_EN.md

+14
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,20 @@ class Solution {
6767
}
6868
```
6969

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+
7084
### **C++**
7185

7286
```cpp
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
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+
};

0 commit comments

Comments
 (0)