Question bank › Monotonic Stack
Dsa Monotonic Stack Hard

Daily Temperatures with Indices

You need to analyze daily temperature data provided as a list of integers. For each day, output the index of the next day that will have a temperature strictly higher than the current day's temperature. If there is no such day, output -1. Implement the function `next_higher_temperature_indices(temperatures: List[int]) -> List[int]`. ### Input A single line with space-separated integers representing temperatures. ### Output A single line with space-separated integers corresponding to the index of the next higher temperature for each day. ### Example Input: 73 74 75 71 69 72 76 73 Output: 1 2 6 5 6 6 -1

Key concepts

monotonic_stacktemperatureindex

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
Part of Praxari's verified interview question bank. We show the prompt and concepts to practise with — never a copy-paste solution.