Code
Loading editor...
Tap Analyze to see visualization
Click Analyze to visualize
See step-by-step execution, variables, and output
Variables
Run code to see variables
Output
Console output will appear here
Click Analyze to visualize
See step-by-step execution, variables, and output
Run code to see variables
Console output will appear here
Binary search the number of days. For each day, count adjacent bloomed flowers in streaks and whether they form at least m bouquets of size k.
As days increase, feasibility is monotonic. If we can make bouquets by day d, we can also do so at any d+1.
Updated Feb 2026