Find Current Chapter Reading Deadline
Find Current Chapter Reading Deadline
MediumBinary Search0% accepted
Priya coordinates a Bangalore book club with weekly chapter assignments and deadlines. Members check which chapter they should be reading today.
Approach
Given sorted chapter deadline days (1-indexed) and today's day number, find the last chapter that should be completed by today.
Input
5
2 4 7 10 14
7
Output
2
More Binary Search 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