Advertisement
Guest User

Untitled

a guest
Dec 13th, 2020
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. List := StrSplit(FileOpen("day13_input.txt","R").Read(),"`r`n")
  2. timestamp := List[1]
  3.  
  4. min := {wait:999999,boat:""}
  5.  
  6. for k, v in StrSplit(List[2],",") {
  7.   if (v=="x")
  8.     continue
  9.   wait := v - Mod(timestamp,v)
  10.   if (wait < min.wait) {
  11.     min.wait := wait
  12.     min.boat := v
  13.   }
  14. }
  15. MsgBox % min.boat * min.wait
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement