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 hacker_id,name,sum(score) as total
from (
select s.hacker_id,s.challenge_id,h.name, max(s.score) as score
from hackers h inner join submissions s on h.hacker_id=s.hacker_id
group by s.hacker_id,s.challenge_id,h.name ) as A
group by hacker_id,name
having sum(score) > 0
order by total desc,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 →
This is my solution
select hacker_id,name,sum(score) as total from ( select s.hacker_id,s.challenge_id,h.name, max(s.score) as score from hackers h inner join submissions s on h.hacker_id=s.hacker_id group by s.hacker_id,s.challenge_id,h.name ) as A group by hacker_id,name having sum(score) > 0 order by total desc,hacker_id asc