Books Problem
Books Problem — ExecCode Medium DSA Practice
Solve the Books problem on ExecCode. Free online medium DSA practice in Two Pointers. Write and run code in Java, C++, Python — no signup required to run.
Problem description
Books must be read in their given order, and each book takes the given number of minutes. You may read only one contiguous sequence of books. Return the most books you can finish without spending more than t minutes. Return the most books readable in time t. You are given: times — times t — t Return the most books readable in time t. Copied from OA Lab Part 1.
Examples
Input {'times': [1], 't': 1}; Output 1. Input {'times': [2], 't': 1}; Output 0. Input {'times': [1, 2, 3], 't': 3}; Output 2
Constraints
Follow the statement. Use a 64-bit integer when values can overflow.
Practice Books free on ExecCode. Browse DSA problems, topic map, and placement guides.