The Bus Route task in today #PerlWeeklyChallenge was surprisingly difficult, but I had fun thinking about it. I uploaded my solution to GitHub.
There are few obvious optimizations I have not pursued (storing only the minimum arrival time instead of list, taking advantage of result not changing until current minute passes departure time, taking advantage of fact that next-after-closest becomes closest once current minute passes departure time).
https://github.com/mirekdlugosz/theweeklychallenge/commit/2136f592c0c70533e19ab8bc185b22ef46738ec9
[#]rust #programming
=> More informations about this toot | More toots from mirekdlugosz@fosstodon.org
text/gemini
This content has been proxied by September (ba2dc).