New
ML System Design & SQL tracks just landed
See what's new
×
Question Bank
Pricing
Blog
Forum
HOT
JobRadar
NEW
Referral
Description
Solution
Discussion
Submissions
Ask AI
Question Bank
Point72
Coding Question
AI Insights
Quick Summary
Simulate a daily borrowing process where each new loan must cover the previous day's outstanding debt.
Maximize consecutive survival days by selecting an optimal sequence of one-time-use lenders.
The outstanding debt is non-decreasing because each lender's payback is at least their lend amount.
What This Tests
Greedy strategy formulation and optimality reasoning
Array sorting and single-pass iteration
Simulation state tracking under constraints
Recognizing monotonic properties in sequential decision problems
Common Patterns
Greedy
Sorting
Collapse
Hint 1
Hint 2
What Interviewers May Ask Next
Accepted
4
/13
Acceptance Rate
30.8%
Ask AI Assistant
Ask AI Assistant
Ask me anything about this coding question!
Qwen
Qwen3.6-Flash
0/2000
Auto
Debug
Run
Submit
Test Cases
Input
lend =
payback =
Output
Expected