Advent of Code 2020 Day 13 Shuttle Search in Clojure

preview_player
Показать описание
Рекомендации по теме
Комментарии
Автор

Beautiful. I think I’ll revisit my solution to make it more elegant.

code_explorations
Автор

Hi Fred. Thanks for the series. I like it.

My two cents. There is `keep-indexed` :) It could replace 4 lines: interleave, partition, map, remove.

(keep-indexed #(when-not (= %2 "x") [%1 (Long/parseLong %2)]))

Also, `when` is a better choice if there is only one branch.

zelark
Автор

Ha, I too overlooked that the buses are coprime, so the Chinese Remainder Theorem works even without factorization.

DanielDugovic
welcome to shbcf.ru