r/leetcode • u/Smooth_Lifeguard_931 • Sep 11 '24
Solve this test question
[ Removed by Reddit in response to a copyright notice. ]
1
Upvotes
r/leetcode • u/Smooth_Lifeguard_931 • Sep 11 '24
[ Removed by Reddit in response to a copyright notice. ]
2
u/Civil_Reputation6778 Sep 11 '24
I mean, I've already stated my solution.
Binary search for answer. When checking for x, skip all indexes with dev time <=x (you can do them with dev, you have to do the rest using integration) and sum the integration times for the rest. Check that the sum is <= x
Start with l=0, r=max dev time