Dsa
Binary Search
Warm-up
The Storage Bin Count
A warehouse stores items in bins organized by weight. All bins are sorted from lightest to heaviest. A manager needs to know how many bins have a weight less than or equal to a limit K. Given the sorted weights of N bins, output the total count of such bins.
Example:
Input:
7 25
10 15 20 25 25 30 35
Output:
5
Key concepts
binary_searchrange_query
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