Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
ductnn committed Apr 12, 2024
1 parent ab81445 commit b231968
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions leetcode/42.TrappingRainWater/sol.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

package main

import (
"fmt"
)

func trap(height []int) int {
res := 0
n := len(height)
Expand Down Expand Up @@ -33,3 +37,9 @@ func max(a, b int) int {

return b
}

func main() {
height := []int{0, 1, 0, 2, 1, 0, 1, 3, 2, 1, 2, 1}

fmt.Println(trap(height))
}

0 comments on commit b231968

Please sign in to comment.