diff --git a/buggy.py b/buggy.py
--- a/buggy.py
+++ b/buggy.py
@@ -3,7 +3,7 @@
 ans = 0
 for i in range(1, N + 1):
     m = list(str(i))
-    for j in range(1, D[i - 1]):
+    for j in range(1, D[i - 1] + 1):
         d = list(str(j))
         if len(set(m + d)) == 1:
             ans += 1
