majority-check-bounds-safe

Status: IN

The short-circuit `and` in `is_majority_element` guarantees `nums[first + n // 2]` is never accessed out of bounds — the left operand `first + n // 2 < n` must be true before the right operand is evaluated.

Source: entries/2026/06/06/check-if-a-number-is-majority-element-in-a-sorted-array-solution.md

JSON