BackmediumUncategorized uncategorized medium

Min Scrolls Shelves Solution

Problem Statement

Given a total number of scrolls and the maximum number of scrolls each shelf can hold, calculate the minimum number of shelves needed to store all the scrolls.

Example 1
Input
10, 2
Output
5

Explanation: We can store 10 scrolls across 5 shelves, each holding 2 scrolls.

Constraints

  • The total number of scrolls should be greater than or equal to 0.
  • The maximum number of scrolls each shelf can hold should be greater than 0.
  • The maximum number of scrolls each shelf can hold should be less than or equal to the total number of scrolls.
Live Compiler
Loading...
Test Cases & Output
🔒 Sign up to run your code

🚀 Practice this problem

Run code, get AI hints & track streak

Sign Up Free