Number of NGEs to the right
Difficulty: Medium
Acceptance: %
Points: 30.00
You are given an array of N integers and Q queries, where each query provides a specific index in the array. For each query, you need to determine how many elements to the right of the given index are strictly greater than the element at that index. Return the results as a list NGEs[], where NGEs[i] represents the count of such elements for the i-th query.
Expected Time Complexity: O(N * queries).
Expected Space Complexity: O(queries).