LeetCode 2683. Neighboring Bitwise XOR in F#

URL

Neighboring Bitwise XOR - LeetCode

Code

https://github.com/syohex/dotnet-study/tree/master/fsharp/leetcode/challenge/202501/neighboring_bitwise_xor/main.fsx

let doesValidArrayExist (derived: int list) : bool =
    let ret1 = derived |> List.fold (fun prev n -> prev ^^^ n) 0
    let ret2 = derived |> List.fold (fun prev n -> prev ^^^ n) 1
    ret1 = 0 || ret2 = 1