3 ms·
You can also use beautiful mutual recursion a la ocaml let rec isEven n = if n = 0 then true else isOdd (n-1) and isOdd n = not (isEven n)
by myaccountonhn 3y ago
You can also use beautiful mutual recursion a la ocaml
let rec isEven n =
if n = 0 then true
else isOdd (n-1)
and isOdd n =
not (isEven n)