Skip to content

Commit 203e1ca

Browse files
author
AmiyahJo
committed
feat: adds typescript file
solution to LeetCode 1929 is included
1 parent 697a72d commit 203e1ca

File tree

1 file changed

+16
-0
lines changed
  • lesson_11/arrays_java/arrays_app/src/main/java/com/codedifferently/lesson11

1 file changed

+16
-0
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
/**
2+
* Provide the solution to LeetCode 1929 here:
3+
* https://leetcode.com/problems/concatenation-of-array
4+
*/
5+
6+
function getConcatenation(nums: number[]): number[] {
7+
let n: number = nums.length;
8+
let ans: number[] = new Array(2*n);
9+
10+
for(let i = 0; i < n; i++){
11+
ans[i] = nums[i];
12+
ans[i + n] = nums[i];
13+
}
14+
15+
return ans;
16+
};

0 commit comments

Comments
 (0)