K
Size: a a a
PD
Dv
open System
[<EntryPoint>]
let main argv =
let n = Console.ReadLine()
let input = Console.ReadLine().Split(" ") |> Array.map (int)
let result = input
|> Array.mapi (fun i v ->
let f = Array.fold (fun (acc: int*int) elem -> // acc = (a, preElem)
if elem - (snd acc) <= 1 then (fst acc + 1, elem)
else acc) (0, 0)
f
)
printf "%A" result
0 // return an integer exit code
6
4 6 5 3 3 1
f
.Dv
VL
f
.VS
PD
Dv
PD
VS
AH
AH
VS
VS
((
VS
AH
AH
AH