Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 0ccf41e

Browse files
committedSep 24, 2021
Add solution #1929
1 parent 83664ec commit 0ccf41e

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed
 

‎README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@
9999
1472|[Design Browser History](./1472-design-browser-history.js)|Medium|
100100
1598|[Crawler Log Folder](./1598-crawler-log-folder.js)|Easy|
101101
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|
102103
2000|[Reverse Prefix of Word](./2000-reverse-prefix-of-word.js)|Easy|
103104

104105
## License
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
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+
};

0 commit comments

Comments
 (0)
Please sign in to comment.