Codey and Gardening
https://www.hackerrank.com/contests/codenection-2024-final-round-closed-category/challenges/cn24-10
Question
The city of CodeNation is having a Gardening Contest, where participants strive to grow as many plants as possible.
The progress of participants is recorded in an array of length n
. Each record will have the format a
p
, where represents the participant's name, and represents how many plants they gained or lost that month. A positive number means they added plants to their garden, while a negative number indicates that they lost some due to harsh weather.
If multiple gardeners end up with the same total, they will get the same ranking.
Zoey, the president of CodeNation, needs assistance in determining the ranking of Codey in the contest.
Input Format
The first line contains an integer n
, where n
represents the number of records.
The following n
lines contain the participant's monthly performance in a
p
format in chronological order, where is a string of lowercase English letters and is an integer.
Constraints
Output Format
Output an integer, the ranking of Codey in the contest.
Sample Inputs:
Last updated