Count how many indices in an array satisfy a dominance condition relative to the rest of the array.
Given an integer array, count the indices that are dominant under the problem’s rule: after removing the element at that index, the remaining values must satisfy the dominance condition defined by the task.
This problem is usually solved by preprocessing aggregate information about the whole array and then checking each index in constant time.
nums.Example 1
Input
nums = [1, 2, 3, 4]
Output
2
Explanation
Illustrative example: two indices satisfy the dominance condition, while the others do not.
Premium problem context
Premium adds guided hints, editorial links, similar variants, discussion resources, and concept maps so you can understand why a problem matters, not just solve it once.