Product
Pricing
Blog
Forum
NEW
Referral
Description
Solution
Discussion
Submissions
Ask AI
AI Insights
Quick Summary
Find the optimal split point k between elevator use and stair climbing to minimize the absolute time difference.
Elevator time scales linearly with k, while stair time typically decreases as starting energy increases.
Each candidate k requires a simulation of the stair descent to verify energy constraints and compute time.
What This Tests
Monotonicity analysis of discrete functions
Binary search over index ranges
Simulation with early termination
Boundary condition and edge case handling
Common Patterns
Binary Search
Monotonicity
Simulation
Collapse
Hint 1
Hint 2
What Interviewers May Ask Next
Report
Report seen similar question in interview
Ask AI Assistant
Ask AI Assistant
Ask me anything about this coding question!
python
Auto
Debug
Run
Submit
Test Cases
Input
Output
Expected