Maximum k Such That at Least k Instances Have Rating at Least k

Problem

Given an array ratings containing ratings of n instances, find the largest integer k such that at least k instances have a rating greater than or equal to k.

Return this max...

Example

Unlock to view complete problem details

and practice with sample input/output

Was this article helpful?

View Test Cases & Run Code requires membership

Standard Input
Execution Result: