mirror of
https://github.com/RGBCube/AdventOfCode
synced 2025-07-26 03:27:44 +00:00
Use or
This commit is contained in:
parent
3b843970e6
commit
6d86d57a77
1 changed files with 1 additions and 4 deletions
|
@ -14,10 +14,7 @@ with builtins; with lib; rec {
|
|||
nine = "9";
|
||||
};
|
||||
|
||||
toDigit = maybeDigit: if digits ? "${maybeDigit}" then
|
||||
digits.${maybeDigit}
|
||||
else
|
||||
maybeDigit;
|
||||
toDigit = maybeDigit: digits.${maybeDigit} or maybeDigit;
|
||||
|
||||
allNeedles = flatten (mapAttrsToList (key: value: [ key (toString value) ]) digits);
|
||||
allNeedlesReverse = map reverseString allNeedles;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue