Problem Statement | |||||||||||||
Your company held a competition to see who could come up with the best quote. The votes are in, and you must now determine the winner.
The voting was held within two groups of voters. Each quote has two numbers of votes - one from each group. The quote with the most total votes is the winner of the competition. There will be no tie for the best quote, i.e., all quotes will receive a distinct number of total votes. You are given a String[] quotes, each element of which represents a single quote and is formatted as "VOTES_1 VOTES_2 QUOTE" (quotes for clarity). VOTES_1 and VOTES_2 are integers representing the number of votes from the first and second groups, respectively, received by the quote. QUOTE is the text of the quote. Return the text of the best quote. | |||||||||||||
Definition | |||||||||||||
| |||||||||||||
Constraints | |||||||||||||
- | quotes will contain between 1 and 50 elements, inclusive. | ||||||||||||
- | Each element of quotes will contain between 5 and 50 characters, inclusive. | ||||||||||||
- | Each element of quotes will be formatted as "VOTES_1 VOTES_2 QUOTE" (quotes for clarity only), where VOTES_1 and VOTES_2 are integers between 1 and 99, inclusive, with no leading zeroes, and QUOTE is a non-empty sequence of lowercase letters ('a'-'z'). | ||||||||||||
- | All QUOTEs will be distinct. | ||||||||||||
- | All sums of VOTES_1 and VOTES_2 will be distinct. | ||||||||||||
Examples | |||||||||||||
0) | |||||||||||||
| |||||||||||||
1) | |||||||||||||
| |||||||||||||
2) | |||||||||||||
| |||||||||||||
3) | |||||||||||||
|