Sponsored
Sponsored
Use these hints if you're stuck. Try solving on your own first.
Use a binary search. We'll binary search the monotone function "possible(D) = can we use K or less gas stations to ensure each adjacent distance between gas stations is at most D?"