2025-08-03 13:42:44 +0300 MSK

Shuffle the Array

Code

class Solution:
    def shuffle(self, nums: List[int], n: int) -> List[int]:
        res = []
        for j in range(n, 2 * n):
            res.extend((nums[j - n], nums[j]))
        return res