
g0701_0800.s0739_daily_temperatures.Solution.swift Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of leetcode-in-all Show documentation
Show all versions of leetcode-in-all Show documentation
104 LeetCode algorithm problem solutions
// #Medium #Top_100_Liked_Questions #Array #Stack #Monotonic_Stack #Programming_Skills_II_Day_6
// #Big_O_Time_O(n)_Space_O(n) #2024_07_03_Time_535_ms_(99.24%)_Space_26.9_MB_(19.32%)
class Solution {
func dailyTemperatures(_ temperatures: [Int]) -> [Int] {
var sol = [Int](repeating: 0, count: temperatures.count)
sol[temperatures.count - 1] = 0
for i in (0..
© 2015 - 2025 Weber Informatics LLC | Privacy Policy