Company: Juspay_29aug
Difficulty: medium
Coolest Peak Temperature Problem Description In the Weather Monitoring Center, meteorologist Alex tracks daily temperatures over a season of n days to identify heatwaves and cooler periods. Using a sliding window approach, Alex examines the temperature data in segments, identifying heatwave peaks and analyzing their intensity. For each period, Alex wants to find the coolest peak temperature across different segments. Specifically, for each window size s, Alex examines all possible consecutive segments of daily temperature readings and identifies the highest temperature (peak) in each segment. Among these peaks, the coolest (minimum) peak is determined to assess the weakest heatwave. For each query, the task is to find the coolest peak temperature observed in all possible windows of the given size s. The goal is to efficiently process multiple queries. Input Format: The first line contains two integers n and q, where n is the number of days with recorded temperature readings, and q is t