LeetCode 2683. Neighboring Bitwise XOR in F#
URL
Neighboring Bitwise XOR - LeetCode
Code
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