dailyTemperatures = function(temperatures, hottest = 0) {
    const days = new Array(temperatures.length).fill(0);

    for (let day = (temperatures.length - 1); (0 <= day); day--) {/* Time O(N + N) */
        const temperature = temperatures[day];

        const isHotter = hottest <= temperature
        if (isHotter) {
            hottest = temperature;
            continue;                                             /* Time O(N + N) */
        }

        search(temperatures, day, temperature, days);             /* Time O(N + N) | Ignore Space O(N) */
    }

    return days;
}
https://leetcode.com/problems/daily-temperatures
Time O(N) | Space O(1)
@param {number[]} temperatures
@return {number[]}