diff --git a/buggy.py b/buggy.py
--- a/buggy.py
+++ b/buggy.py
@@ -6,7 +6,7 @@
     for x in range(10):
         s_x = int(s[x])
         count[s_x][x] += 1
-        time[s_x].append(i + (count[s_x][x] - 1) * 10)
+        time[s_x].append(x + (count[s_x][x] - 1) * 10)
 ans = 10**100
 for i in range(10):
     ans = min(ans, max(time[i]))
