diff --git a/1470-shuffle-the-array/1470-shuffle-the-array.py b/1470-shuffle-the-array/1470-shuffle-the-array.py new file mode 100644 index 0000000..d266d79 --- /dev/null +++ b/1470-shuffle-the-array/1470-shuffle-the-array.py @@ -0,0 +1,3 @@ +class Solution: + def shuffle(self, nums: List[int], n: int) -> List[int]: + return [ nums[int(i / 2)] if i % 2 == 0 else nums[n + int(i / 2)] for i in range(2 * n) ] \ No newline at end of file