Spring Hire Sale
Limited Time Deal: Unlock all premium questions for over 30% off
$10.42$7.08
08
:
03
:
08
:
30
Back to Dashboard
Rating Cutoff For Loss Rate
Medium
A game analytics platform needs to identify a skill rating threshold above which players lose at least a target proportion of their games. You are given a list matches where each element is [rating_str, result]: rating_str is a non-negative integer encoded as a string, and result is either "win" or "lose". Find the smallest non-negative integer cutoff s such that among all matches with rating >= s, the proportion of losses is at least threshold.
Return -1 if no valid cutoff exists. A cutoff is invalid if there are no matches with rating >= s.
...