Skip to content

Commit 85acf58

Browse files
authored
Create Concatenation-of-Array.py
1 parent 450ccf1 commit 85acf58

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

Leetcode/Concatenation-of-Array.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
class Solution:
2+
def getConcatenation(self, nums: List[int]) -> List[int]:
3+
ans = [0] * len(nums) * 2
4+
counter = 0
5+
for i in range(0, len(ans)):
6+
if i < len(nums):
7+
ans[i] = nums[i]
8+
else:
9+
ans[i] = nums[counter]
10+
counter += 1
11+
return ans

0 commit comments

Comments
 (0)