Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let calculateSeries data =
- let rec traverseData data origin start count = seq {
- match data with
- | [] -> yield (start, count)
- | h::t ->
- if origin = h then
- yield! traverseData t origin start (count + 1)
- else
- yield (start, count)
- yield! traverseData t h (start + count) 1
- }
- match data with
- | [] -> []
- | h::t -> traverseData data h 0 0 |> List.ofSeq
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement