mirror of
https://github.com/halfrost/LeetCode-Go.git
synced 2025-07-06 09:23:19 +08:00
11 lines
202 B
Go
11 lines
202 B
Go
package leetcode
|
|
|
|
func shuffle(nums []int, n int) []int {
|
|
result := make([]int, 0)
|
|
for i := 0; i < n; i++ {
|
|
result = append(result, nums[i])
|
|
result = append(result, nums[n+i])
|
|
}
|
|
return result
|
|
}
|