File tree Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Original file line number Diff line number Diff line change 99
99
1472|[ Design Browser History] ( ./1472-design-browser-history.js ) |Medium|
100
100
1598|[ Crawler Log Folder] ( ./1598-crawler-log-folder.js ) |Easy|
101
101
1880|[ Check if Word Equals Summation of Two Words] ( ./1880-check-if-word-equals-summation-of-two-words.js ) |Easy|
102
+ 1929|[ Concatenation of Array] ( ./1929-concatenation-of-array.js ) |Easy|
102
103
2000|[ Reverse Prefix of Word] ( ./2000-reverse-prefix-of-word.js ) |Easy|
103
104
104
105
## License
Original file line number Diff line number Diff line change
1
+ /**
2
+ * 1929. Concatenation of Array
3
+ * https://leetcode.com/problems/concatenation-of-array/
4
+ * Difficulty: Easy
5
+ *
6
+ * Given an integer array `nums` of length `n`, you want to create an
7
+ * array `ans` of length `2n` where `ans[i] == nums[i`] and
8
+ * `ans[i + n] == nums[i]` for `0 <= i < n` (0-indexed).
9
+ *
10
+ * Specifically, `ans` is the concatenation of two `nums` arrays.
11
+ *
12
+ * Return the array `ans`.
13
+ */
14
+
15
+ /**
16
+ * @param {number[] } nums
17
+ * @return {number[] }
18
+ */
19
+ var getConcatenation = function ( nums ) {
20
+ return [ ...nums , ...nums ] ;
21
+ } ;
You can’t perform that action at this time.
0 commit comments