1470. Shuffle the Array 배열섞기
leedcode Easy 1470. Shuffle the Array Given the array nums consisting of 2n elements in the form [x1,x2,...,xn,y1,y2,...,yn]. Return the array in the form [x1,y1,x2,y2,...,xn,yn]. 더보기 def shuffle(self, nums: List[int], n: int) -> List[int]: numlen = len(nums) -1 res = [] for i in range(n) : res.append(nums[i]) res.append(nums[numlen-(n-i-1)]) return res def shuffle(self, nums: List[int], n: int)..
2021. 10. 26.