diff --git a/buggy.py b/buggy.py
--- a/buggy.py
+++ b/buggy.py
@@ -15,7 +15,7 @@
         s2 = total
         arr = []
         for i in range(n):
-            arr.append(abs(s1 - (nums[i] * i)) + abs((s2 - (nums[i + 1]) * (n - i))))
+            arr.append(abs(s1 - (nums[i] * i)) + abs((s2 - (nums[i]) * (n - i))))
             s1 = s1 + nums[i]
             s2 = total - s1
 
