We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
There seems to be some ambiguity in the problem statement regarding ordering. Specifically..
"The report must be in descending order by grade -- i.e. higher grades are entered first. If there is more than one student with the same grade (1-10) assigned to them, order those particular students by their name alphabetically. Finally, if the grade is lower than 8... list them by their marks in ascending order."
This last statement could easily be interpreted as, "ALL records with grade lower than 8 should be listed by their marks in ascending order. (And not in descending order by grade.)"
However, the test code is expecting these to be ordered by grade first (descending) then by mark (ascending).
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
The Report
You are viewing a single comment's thread. Return to all comments →
There seems to be some ambiguity in the problem statement regarding ordering. Specifically..
"The report must be in descending order by grade -- i.e. higher grades are entered first. If there is more than one student with the same grade (1-10) assigned to them, order those particular students by their name alphabetically. Finally, if the grade is lower than 8... list them by their marks in ascending order."
This last statement could easily be interpreted as, "ALL records with grade lower than 8 should be listed by their marks in ascending order. (And not in descending order by grade.)"
However, the test code is expecting these to be ordered by grade first (descending) then by mark (ascending).