7 kyu
Whose bicycle?
6,339Dmitry Kudla
Description:
I am the father of three wonderful sons. before the beginning of the school year, I promised them that I would buy a bicycle for someone who would bring the best marks at the end of the school year. it's time to keep promises and I count on you.
You have 3 input objects(school diaries) with school subjects and marks (1-10). For example:
{
'algebra': 6,
'history': 8,
'physics': 9,
'geography': 2,
'chemistry': 9
}
Return please :
'I need to buy a bicycle for my first son.' // the sum of the marks is the highest in the first diary.
'I need to buy a bicycle for my second son.' // the sum of the marks is the highest in the second diary.
'I need to buy a bicycle for my third son.' // the sum of the marks is the highest in the third diary.
If two or three sons have the same highest marks, you need to choose the younger one. Use the ageTable object which is preloaded:
ageTable = {
'firstSonAge': 14,
'secondSonAge': 9,
'thirdSonAge': 8
}
Fundamentals
Similar Kata:
Stats:
Created | Dec 10, 2017 |
Published | Dec 10, 2017 |
Warriors Trained | 8342 |
Total Skips | 48 |
Total Code Submissions | 25539 |
Total Times Completed | 6339 |
JavaScript Completions | 6339 |
Total Stars | 48 |
% of votes with a positive feedback rating | 88% of 574 |
Total "Very Satisfied" Votes | 468 |
Total "Somewhat Satisfied" Votes | 73 |
Total "Not Satisfied" Votes | 33 |
Total Rank Assessments | 5 |
Average Assessed Rank | 7 kyu |
Highest Assessed Rank | 7 kyu |
Lowest Assessed Rank | 8 kyu |