You are tasked with managing a garden where you need to plant and grow N different flower seeds to achieve full bloom. Each seed requires a specific number of days to plant and then additional days to grow before blooming. You can only work on planting one seed per day, but once a seed is fully planted, it grows automatically without requiring your attention. Your goal is to determine the optimal planting order to minimize the total time until all flowers have bloomed.
The key challenge is to strategically order the seeds such that while some are growing, you can continue planting others, thereby overlapping growth and planting periods efficiently to achieve the earliest possible bloom day for all flowers.
You need to implement the function earliestFullBloom. This function should determine the minimum number of days required for all seeds to be fully bloomed by optimally ordering the planting sequence.
N: An integer representing the number of seeds.plantTime: An array/vector of N integers where plantTime[i] represents the number of consecutive days required to plant the i-th seed.growTime: An array/vector of N integers where growTime[i] represents the number of days the i-th seed takes to grow after being completely planted.An integer representing the earliest day on which all seeds will be blooming.
A single integer — the earliest day number when all flowers are blooming.