let next memory current =
let currentWinner =
match memory with
| None, None -> None
| Some v, None -> Some v
| None, Some v -> Some (v*current)
| Some winning, Some last -> Some (max winning (current * last))
currentWinner, Some current
let adjacentElementsProduct = fst << Array.fold next (None, None)