As reported: BlackRock Associate, C++ developer, Apr 2025, round 1: after the modern C++ discussion, LeetCode 739 Daily Temperatures in the last 15 minutes, including its time and space complexity.
Given an array temperatures of daily temperatures, return an array answer where answer[i] is the number of days after day i until a warmer temperature. If no future day is warmer, answer[i] = 0.
This is LeetCode 739 — Daily Temperatures.
Example 1
temperatures = [73,74,75,71,69,72,76,73] -> [1,1,4,2,1,1,0,0]
Example 2
temperatures = [30,40,50,60] -> [1,1,1,0]
Constraints: 1 ≤ temperatures.length ≤ 10^5; 30 ≤ temperatures[i] ≤ 100.
Code runner format: one JSON value per line: temperatures (LeetCode's test-case format). Implement dailyTemperatures(temperatures); the harness prints the returned array.