Trains the technique from
LeetCode 3978Unique Middle ElementThis is an original problem, written from a brief that listed the technique, the difficulty, the topics, the function shape and the input bounds — none of that problem's wording, examples, hints or editorials. The link is there so you can map your practice onto the standard set.
Same function shape, different story and different numbers.
Readings are given as nums, and there is an odd number of them, so exactly one sits in the middle.
Return true when that middle reading appears nowhere else in the list.
Example 1
The middle reading is 27, which appears nowhere else.
Example 2
The middle reading is 2 and it is the only 2 on the list, even though the reading 1 is repeated.
Example 3
The middle reading is 3, on its own, so the four eights around it make no difference.
The editor is preloaded with this. It matches the parent problem's shape, so a solution that works here transfers to a judge unchanged.
def is_middle_element_unique(nums: list[int]) -> bool:public boolean isMiddleElementUnique(int[] nums)See the step-by-step animation, the intuition, and clean code in every language — free, no credit card.