← back to unit
Medium
# searching medium
Find the Odd One Out Position
Every gift box on the shelf weighs the same — except one, which is hiding the surprise. 🎁
You get a list of weights where every value is identical except a single different one. Print the position (from 0) of the odd one out. There are at least 3 boxes.
Example:
Input: weights = [5, 5, 5, 9, 5]
Output: 3
The first two boxes match, so 5 is the normal weight — the box that doesn't match it, 9, sits at position 3.
💡 need a hint?
srch-odd-one-out-position.py🔒 given lines are locked — write your code in between
loading...