Skip to content

Commit 8ee6e4e

Browse files
Create 1929-Concatenation-of-Array.dart
1 parent 8c1429a commit 8ee6e4e

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

dart/1929-Concatenation-of-Array.dart

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
//Time Complexity: O(n)
2+
//Space Complexity: O(n)
3+
4+
class Solution {
5+
List<int> getConcatenation(List<int> nums) {
6+
List<int> ans = List<int>.filled(2 * nums.length, 0);
7+
for (int i = 0; i < nums.length; i++) {
8+
ans[i] = nums[i];
9+
ans[i + nums.length] = nums[i];
10+
}
11+
return ans;
12+
}
13+
}

0 commit comments

Comments
 (0)