Created
December 20, 2016 22:23
-
-
Save theburningmonk/a0ce04f008a20c2347fe18551ab66341 to your computer and use it in GitHub Desktop.
Advent of Code (Day 20)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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