diff --git a/buggy.py b/buggy.py
--- a/buggy.py
+++ b/buggy.py
@@ -22,6 +22,6 @@
 
 mn = float("inf")
 for i in range(1, n):
-    mn = min(mn, oz[i - 1] + zo[-1] - zo[i - 1], zo[i - 1] + oz[-1] - oz[i - 1])
+    mn = min(mn, oz[i] + zo[-1] - zo[i], zo[i] + oz[-1] - oz[i])
 
 print(mn)
