Skip to content

Instantly share code, notes, and snippets.

@RayMPerry
Last active December 1, 2020 22:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save RayMPerry/0755df10463608e8b761b978fb194285 to your computer and use it in GitHub Desktop.
Save RayMPerry/0755df10463608e8b761b978fb194285 to your computer and use it in GitHub Desktop.
pain
use v6;
say "({ .[0] }) * ({ .[1]}) = ({ [*] $_ })" if .sum == 2020 for 'input.txt'.IO.lines.map({ .Int }).combinations: 2;
say "({ .[0] }) * ({ .[1]}) * ({ .[2] }) = ({ [*] $_ })" if .sum == 2020 for 'input.txt'.IO.lines.map({ .Int }).combinations: 3;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment