Advertisement
Guest User

Untitled

a guest
Dec 15th, 2020
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. SetWorkingDir %A_ScriptDir%
  2.  
  3. FileRead, nuStr, % A_ScriptDir "\d15.txt"
  4.  
  5. nuA := StrSplit(nuStr, ",")
  6.  
  7. nuAr := {}
  8. for i, j in nuA {
  9.     nuAr[j] := {}
  10.     nuAr[j]["last"] := i
  11.     lastNum := j
  12. }
  13.  
  14. Loop, 2020
  15. {
  16.     i := A_Index
  17.     if (i <= nuA.MaxIndex())
  18.         Continue
  19.     if !nuAr[lastNum].prev {
  20.         num := "0"
  21.     }
  22.     else {
  23.         num := nuAr[lastNum].last - nuAr[lastNum].prev
  24.     }
  25.     if !nuAr[num]
  26.         nuAr[num] := {}
  27.     nuAr[num]["prev"] := nuAr[num].last
  28.     nuAr[num]["last"] := A_Index
  29.     lastNum := num
  30. }
  31.  
  32. Clipboard := lastNum
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement