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.
with
chall_sub
as(SELECT su.hacker_id,su.challenge_id,difficulty_level,max(score) as highscore
FROM Submissions su
INNER JOIN Challenges ch ON su.challenge_id=ch.challenge_id
GROUP BY su.hacker_id,su.challenge_id,difficulty_level)
SELECT Ha.hacker_id,Ha.name
FROM
Hackers Ha
INNER JOIN chall_sub cs ON Ha.hacker_id= cs.hacker_id
INNER JOIN Difficulty dif ON cs.difficulty_level= dif.difficulty_level
AND cs.highscore=dif.score
GROUP BY Ha.hacker_id,Ha.name
HAVING COUNT(cs.challenge_id)>1
ORDER BY COUNT(cs.challenge_id) desc,Ha.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
An unexpected error occurred. Please try reloading the page. If problem persists, please contact support@hackerrank.com
Top Competitors
You are viewing a single comment's thread. Return to all comments →
with chall_sub as(SELECT su.hacker_id,su.challenge_id,difficulty_level,max(score) as highscore FROM Submissions su INNER JOIN Challenges ch ON su.challenge_id=ch.challenge_id GROUP BY su.hacker_id,su.challenge_id,difficulty_level)
SELECT Ha.hacker_id,Ha.name FROM Hackers Ha INNER JOIN chall_sub cs ON Ha.hacker_id= cs.hacker_id INNER JOIN Difficulty dif ON cs.difficulty_level= dif.difficulty_level AND cs.highscore=dif.score GROUP BY Ha.hacker_id,Ha.name HAVING COUNT(cs.challenge_id)>1 ORDER BY COUNT(cs.challenge_id) desc,Ha.hacker_id asc