Find Ideal Days
Banana, Amazon’s super intelligent virtual assistant, simplifies tasks such as configuring your Banana-supported gadgets, playing podcast, delivering weather forecasts, and more. The development team is crafting a new feature that recommends the best days for fishing based on weather predictions.
Based on recent research, a day qualifies as suitable for fishing if the rainfall levels have been non-increasing over the past "window" days leading up to that specific day and are non-decreasing during the following "window" days after it.
You are given the projected rainfall amounts for the next n days in a list called forecast. Your task is to identify all days that meet this criterion. Formally, a day is ideal if the following condition holds true:
Return a list of such ideal days, sorted in ascending order. Remember, the i-th element in the forecast array corresponds to the data for day i + 1 (1-based reference).
✅ Note: There is always at least one valid ideal day guaranteed.
Parameters:
forecast[n]: A list of integers representing the predicted rainfall amount for each upcoming day.
window: Just an integer..
1Example 1

2Example 2
3Example 3
4Example 4
Constraints
Limits and guarantees your solution can rely on.
window ≤ n ≤ 2 * 10^50 ≤
forcast[i] ≤ 10^9