본문 바로가기
python-algorithm

Leetcode 1470. Shuffle the Array

by 무적김두칠 2021. 7. 13.

1
2
3
4
5
6
7
class Solution:
    def shuffle(self, nums: List[int], n: int-> List[int]:
        tmp=[]
        for i in range(n):
            tmp.append(nums[i])
            tmp.append(nums[n+i])
        return tmp
cs

 

반응형

댓글