Search
⌘K

Leetcode 2519. Count the Number of K-Big Indices

Given an integer array and k, count indices i such that the element at i is "k-big" — i.e., there are at least k elements greater than nums[i] on both its left and its right. Solving this efficiently requires prefix/suffix order-statistics (coordinate compression + Fenwick/segment tree or balanced BST) to compute those counts in O(n log n).


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Comments

Your account is free and you can post anonymously if you choose.