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.
If the grade of two students are less than 8 and they are equal (like if A got 55 and B got 58, both recieve the same grade 6) then list them in increasing order of their marks.
i.e.
NULL 6 55 (record of A) followed by NULL 6 58 (record of B)
So first order by grade in descending order, then by marks in ascending order if grade is less than 8.
Otherwise order by grade in descending order, and name in acending order if grade is >= 8
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 →
If the grade of two students are less than 8 and they are equal (like if A got 55 and B got 58, both recieve the same grade 6) then list them in increasing order of their marks.
i.e.
NULL 6 55 (record of A) followed by NULL 6 58 (record of B)
So first order by grade in descending order, then by marks in ascending order if grade is less than 8.
Otherwise order by grade in descending order, and name in acending order if grade is >= 8