Find Minimum Pages Per Day

Problem Overview

  • Determine the minimum x pages/day so a student finishes n chapters within given days.
  • Inputs: pages[] and days; Output: minimum x or -1 if not possible.
  • Rules: read chapters in order; per day read up to x or finish the current chapter; only one chapter per day.
  • Context: study pacing for an exam via Amazon Academy.
  • From Amazon interviews; a coding interview problem and common interview question.

Example

Unlock to view complete problem details

and practice with sample input/output

Was this article helpful?

View Test Cases & Run Code requires membership

Input Variables
Execution Result: