Flat Allotment by Priority Score
Flat Allotment by Priority Score
MediumArrays0% accepted
Meera manages flat allotments in a Mumbai housing society. Applicants have different priority scores based on registration date and family size. Assign apartments to applicants in priority order.
Approach
Given an array of applicant priority scores and apartment numbers, return the apartment assignments sorted by priority in descending order.
Input
priorities=[5,3,8,1], apartments=[101,102,103,104]
Output
[103,101,102,104]
More Arrays problems
Browse all coding problems →solution.py
Loading editor...
Test 1
Test 2
Test 3
Press Run to test your custom input, or Submit to judge against all test cases.
Sign in to continue
Create a free account to run code, submit solutions and track progress.
- Free forever — no credit card
- 10+ languages with live execution
- Points, streaks & leaderboards