We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents e110521 + c68c1e3 commit 702879dCopy full SHA for 702879d
javascript/1929-Concatenation-of-Array.js
@@ -0,0 +1,13 @@
1
+//https://leetcode.com/problems/concatenation-of-array/description/
2
+
3
+/**
4
+ * @param {number[]} nums
5
+ * @return {number[]}
6
+ */
7
+var getConcatenation = function (nums) {
8
+ let res = [];
9
+ for (let i = 0; i < nums.length * 2; i++) {
10
+ res.push(nums[i % nums.length]);
11
+ }
12
+ return res;
13
+};
0 commit comments