Skip to content

Commit

Permalink
Time: 128 ms (70.37%), Space: 10.6 MB (55.62%) - LeetHub
Browse files Browse the repository at this point in the history
  • Loading branch information
hovanhoa committed Oct 17, 2024
1 parent a23125e commit 9a4b655
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions 0739-daily-temperatures/0739-daily-temperatures.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
func dailyTemperatures(temperatures []int) []int {
n := len(temperatures)
ans := make([]int, n)
ans := make([]int, len(temperatures))
stack := make([]int, 0)
for i, v := range temperatures {
for len(stack) > 0 && v > temperatures[stack[len(stack)-1]] {
Expand Down

0 comments on commit 9a4b655

Please sign in to comment.