Tap here to switch tabs
Problem
Submissions

Problem: Count Elements With at Least K Greater Values

Try to solve the Count Elements With at Least K Greater Values problem.

Statement

Given an integer array nums of length n and an integer k, return the number of elements in nums that have at least k elements strictly greater than themselves.

Constraints:

  • 1≤n==1 \leq n == nums.length ≤105\leq 10^5

  • 1≤1 \leq nums[i] ≤109\leq 10^9

  • 0≤0 \leq k <n< n

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Count Elements With at Least K Greater Values

Try to solve the Count Elements With at Least K Greater Values problem.

Statement

Given an integer array nums of length n and an integer k, return the number of elements in nums that have at least k elements strictly greater than themselves.

Constraints:

  • 1≤n==1 \leq n == nums.length ≤105\leq 10^5

  • 1≤1 \leq nums[i] ≤109\leq 10^9

  • 0≤0 \leq k <n< n