Retired
League Champions (retired)
31Kadishay
Description:
Implement a function named winner(results)
which takes the
match results of each team in the league, and returns who won the championship (got the most points).
A team wins if it's score in a game is higher than the other team and is awarded 3 points.
A team loses if it's score in a game is lower than the other team and is awarded 0 points.
The game ties if both teams score is the same and each team will be awarded 1 point.
Example Input:
{
teamA: ["1:0", "3:3"],
teamB: ["0:1", "3:1"],
teamC: ["3:3", "1:3"]
}
Output would be: 'teamA'. Since teamA got 4 points, while teamB got 3 points, and teamC got 1 point.
No 2 teams wlll have the same number of points at the end of the league. There will be no empty inputs.
Fundamentals
Similar Kata:
Stats:
Created | Feb 1, 2019 |
Warriors Trained | 54 |
Total Skips | 0 |
Total Code Submissions | 221 |
Total Times Completed | 31 |
JavaScript Completions | 31 |
Total Stars | 1 |
% of votes with a positive feedback rating | 68% of 22 |
Total "Very Satisfied" Votes | 14 |
Total "Somewhat Satisfied" Votes | 2 |
Total "Not Satisfied" Votes | 6 |
Total Rank Assessments | 23 |
Average Assessed Rank | 6 kyu |
Highest Assessed Rank | 1 kyu |
Lowest Assessed Rank | 8 kyu |