Property Price Band Distribution Count
Property Price Band Distribution Count
MediumArrays100% accepted
Priya helps buyers filter properties on MagicBricks in Bangalore. She needs to categorize properties into multiple price bands and count how many fall into each category.
Approach
Given an array of property prices and multiple price band ranges, return the count of properties in each band.
Input
prices=[25,50,75,100,125], bands=[[0,50],[51,100],[101,150]]
Output
[2,2,1]
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