Skip to content

Instantly share code, notes, and snippets.

@theburningmonk
Created December 20, 2016 22:23
Show Gist options
  • Select an option

  • Save theburningmonk/a0ce04f008a20c2347fe18551ab66341 to your computer and use it in GitHub Desktop.

Select an option

Save theburningmonk/a0ce04f008a20c2347fe18551ab66341 to your computer and use it in GitHub Desktop.
Advent of Code (Day 20)
let findAllowedIPs input =
let rec loop lo hi input = seq {
match input with
| [] -> ()
| (lo', hi')::tl ->
if lo' > hi + 1L then
yield! { hi+1L .. lo'-1L}
yield! loop lo (max hi hi') tl
}
loop 0L 0L input
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment