add new solutions
This commit is contained in:
parent
9a10695e8c
commit
ca24d0a56a
30 changed files with 697 additions and 16 deletions
14
solutions/14/q1470/solution.go
Normal file
14
solutions/14/q1470/solution.go
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
package q1470
|
||||
|
||||
func shuffle(nums []int, n int) []int {
|
||||
ret := make([]int, n*2)
|
||||
for i, num := range nums[:n] {
|
||||
ret[i*2] = num
|
||||
}
|
||||
for i, num := range nums[n : n*2] {
|
||||
ret[i*2+1] = num
|
||||
}
|
||||
return ret
|
||||
}
|
||||
|
||||
var _ = shuffle
|
||||
Loading…
Add table
Add a link
Reference in a new issue