Back to problems

Find the highest eligible score

Algorithm · Upstart · Easy

You are given a sequence of records, where each record consists of a name and an integer score, along with an integer threshold. Remove from consideration every record whose score is greater than threshold. From the records that remain, locate the one with the largest score and return its name. If two or more qualifying records share the same largest score, return the name belonging to the record that occurs earliest in the original sequence. If no record qualifies, return…

Checking your access…