Question bank › Arrays
Dsa Arrays Easy

Ranking Overlaps

You are given an array of students' scores and want to report how many students scored higher than each student. The input format is as follows: Input: - The first line contains a single integer n (1 <= n <= 1000) - the number of students. - The second line contains n space-separated integers, the scores of the students. Output: - Print n integers, where the ith integer indicates how many students scored higher than the score of the ith student. Example: Input: 5 50 80 90 80 100 Output: 3 1 0 1 0

Key concepts

arrayssortingoverlaps

Practise this out loud — free

Start a mock interview on THIS exact question — a voice AI interviewer opens with it, pushes back like a real onsite, then hands you an instant scorecard.

🎙 Practise this question now
Part of InterviewLab's verified interview question bank. We show the prompt and concepts to practise with — never a copy-paste solution.