Practice Minimum Number of Days to Make m Bouquets
Read the task, work through the examples, and check your approach against the constraints. Use the original LeetCode task for coding and submissions.
Problem Statement
You are given an integer array bloomDay, an integer m and an integer k. You want to make m bouquets. To make a bouquet, you need to use k adjacent flowers from the garden. The garden consists of n flowers, the ith flower will bloom in the bloomDay[i] and then can be used in exactly one bouquet. Return the minimum number of days you need to wait to be able to make m bouquets from the garden. If it is impossible to make m bouquets return -1.
Source: Minimum Number of Days to Make m Bouquets on LeetCode. Use the original task for its coding environment and submissions.
Examples
# Example 1
bloomDay = [1,10,3,10,2], m = 3, k = 1
3
# Example 2
bloomDay = [1,10,3,10,2], m = 3, k = 2
-1
# Example 3
bloomDay = [7,7,7,7,12,7,7], m = 2, k = 3
12
Constraints
Related LeetCode Problems
Practice more problems similar to Minimum Number of Days to Make m Bouquets.
Review your practice with PhantomCodeAI
After trying the problem yourself, use the app to discuss your approach, complexity, and edge cases.