7 kyu

Whose bicycle?

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

Stats:

CreatedDec 10, 2017
PublishedDec 10, 2017
Warriors Trained8342
Total Skips48
Total Code Submissions25539
Total Times Completed6339
JavaScript Completions6339
Total Stars48
% of votes with a positive feedback rating88% of 574
Total "Very Satisfied" Votes468
Total "Somewhat Satisfied" Votes73
Total "Not Satisfied" Votes33
Total Rank Assessments5
Average Assessed Rank
7 kyu
Highest Assessed Rank
7 kyu
Lowest Assessed Rank
8 kyu
Ad
Contributors
  • Dmitry Kudla Avatar
  • adrian.eyre Avatar
  • hobovsky Avatar
  • BobtheLantern Avatar
Ad