public class Solution {
public int[] Shuffle(int[] nums, int n) {
var list = new List<int>();
for (var i = 0; i < n; ++i) {
list.Add(nums[i]);
list.Add(nums[n + i]);
}
return list.ToArray();
}
}
Source: https://leetcode.com/problems/shuffle-the-array/
"Simplicity can't be bought later, it must be earned from the start" -- DB
Sunday, February 14, 2021
Leetcode everyday: 1470. Shuffle the Array. Easy
Labels:
leetcode
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment