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.
select h.hacker_id,h.name,sum(s.max_score) as total_score from hackers h
join (select ss.hacker_id,ss.challenge_id,max(score) as max_score
from submissions ss
group by ss.hacker_id,ss.challenge_id ) as s on h.hacker_id=s.hacker_id
group by h.hacker_id,h.name
having total_score>0
order by total_score DESC,h.hacker_id ASC
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Contest Leaderboard
You are viewing a single comment's thread. Return to all comments →
My Code:
select h.hacker_id,h.name,sum(s.max_score) as total_score from hackers h join (select ss.hacker_id,ss.challenge_id,max(score) as max_score from submissions ss group by ss.hacker_id,ss.challenge_id ) as s on h.hacker_id=s.hacker_id group by h.hacker_id,h.name having total_score>0 order by total_score DESC,h.hacker_id ASC