Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

42. Trapping Rain Water #10

Open
F4NT0 opened this issue Apr 20, 2024 · 0 comments
Open

42. Trapping Rain Water #10

F4NT0 opened this issue Apr 20, 2024 · 0 comments
Assignees
Labels
Hard Hard Questions Ready to code Description from the Question was updated with code and text

Comments

@F4NT0
Copy link
Owner

F4NT0 commented Apr 20, 2024

Given n non-negative integers representing an elevation map where the width of each bar is 1, compute how much water it can trap after raining.

Example 1:

image

  • Input: height = [0,1,0,2,1,0,1,3,2,1,2,1]
  • Output: 6
  • Explanation: The above elevation map (black section) is represented by array [0,1,0,2,1,0,1,3,2,1,2,1]. In this case, 6 units of rain water (blue section) are being trapped.

Example 2:

  • Input: height = [4,2,0,3,2,5]
  • Output: 9

Constraints:

  • n == height.length
  • 1 <= n <= 2 * 104
  • 0 <= height[i] <= 105
@F4NT0 F4NT0 added the Hard Hard Questions label Apr 20, 2024
@F4NT0 F4NT0 added this to the April Leetcode milestone Apr 20, 2024
@F4NT0 F4NT0 self-assigned this Apr 20, 2024
@F4NT0 F4NT0 added the Ready to code Description from the Question was updated with code and text label Apr 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Hard Hard Questions Ready to code Description from the Question was updated with code and text
Projects
None yet
Development

No branches or pull requests

1 participant