anonymous1184

Advent of Code 2020.1 AHK

Dec 1st, 2020 (edited)
438
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. sum := 2020
  2. values := [1721, 979, 366, 299, 675, 1456]
  3.  
  4. for idx,key in values
  5. {
  6.     outter := values[idx]
  7.     loop, % values.Count() - idx
  8.     {
  9.         inner := values[A_Index + (idx - 1)]
  10.         if (outter + inner = sum)
  11.         {
  12.             break, 2
  13.         }
  14.     }
  15.     outter := inner := 0
  16. }
  17. OutputDebug, % (!outter && !inner ? "Error" : "R: " (outter * inner))
Add Comment
Please, Sign In to add comment