Browse Source
Keeping the old solution for the ranges was too ineffective when it came to enumerating all contained integers, the amount of elements was too large to either expand the ranges into Sets or similar. However, it turned out (after some thinking) to be fairly straight-forward to check if consecutive ranges overlapped, and in that case merge them. The solution therefore now parses the ranges, sorts them on the first component and then merges them as far as possible. changes: JJ: M app/Day5.hs
1 changed files with 25 additions and 4 deletions
Loading…
Reference in new issue