Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit4a37f96

Browse files
authored
Merge pull requestneetcode-gh#2658 from codewithsatyam/main
Create: 1929-Concatenation-of-Array.dart
2 parentsd8b8359 +4b35f5c commit4a37f96

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

‎dart/1929-concatenation-of-array.dart

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
// Time Complexity: O(n)
2+
// Space Complexity: O(n)
3+
4+
classSolution {
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+
14+
115
classSolution {
216
List<int>getConcatenation(List<int> nums) {
317
return nums+ nums;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp