Top Competitors

  • + 1 comment

    SELECT h.hacker_id, h.name FROM Hackers h JOIN Submissions s ON h.hacker_id = s.hacker_id JOIN Challenges c ON s.challenge_id = c.challenge_id -- Ensure correct challenge join JOIN Difficulty d ON c.difficulty_level = d.difficulty_level GROUP BY h.hacker_id, h.name HAVING COUNT(CASE WHEN s.score = d.score THEN 1 END) > 1 -- Count only the challenges with full score ORDER BY COUNT(CASE WHEN s.score = d.score THEN 1 END) DESC, h.hacker_id ASC;