Dsa
Two Pointers
Medium
Temperature Trend
You have recorded temperatures for a week (7 days), and you want to find the maximum number of consecutive days where the temperature increases, starting from the coldest day. Return the length of this subsequence of consecutive days.
Input:
- A single line containing 7 space-separated integers representing the temperatures of the week.
Output:
- Print the length of the longest consecutive increasing subsequence of temperatures.
Example:
Input:
30 32 28 29 31 35 40
Output:
4
Key concepts
two_pointerstemperature_analysis
Practise this out loud — free
Start a mock interview on THIS exact question — a voice AI interviewer opens with it, pushes back like a real onsite, then hands you an instant scorecard.
🎙 Practise this question now