LeetCode 1470. Shuffle the Array in F#
URL
Code
https://github.com/syohex/dotnet-study/tree/master/fsharp/leetcode/problems/1470/main.fsx
let shuffle (nums: int list) (n: int) : int list =
(List.take n nums, List.skip n nums)
||> List.zip
|> List.fold (fun acc (x, y) -> y :: x :: acc) []
|> List.rev