← back to unit
Medium
# breaking it down medium
The Balance Point
Find the magic stone where the weights to its LEFT equal the weights to its RIGHT (the stone itself counts for neither). ⚖️
You get the weights. Print the position (from 0) of the first such balance point, or none.
Example:
Input: weights = [1, 7, 3, 6, 5, 6]
Output: 3
At position 3 (value 6), the left side (1+7+3=11) equals the right side (5+6=11) — a balance point.
💡 need a hint?
brk-balance-point.py🔒 given lines are locked — write your code in between
loading...