Back to Browse

Trapping Rain Water (LeetCode 42) | Interview Essential | Full visual solution

8.1K views
Jan 26, 2026
21:00

πŸ‘‰ πŸ‘‰ Super helpful resources: https://nikoo28.github.io/all-my-links/ Actual Problem: https://leetcode.com/problems/trapping-rain-water/description/ Chapters: 00:00 - Intro 00:53 - Problem Statement 05:36 - Naive approach 11:09 - Efficient O(n) solution 17:18 - Dry-run of Code 20:02 - Final thoughts πŸ“š Links to topics I talk about in the video: Dynamic Programming: https://www.youtube.com/playlist?list=PLFdAYMIVJQHPXtFM_9mpwwQtIdzP6kxHS πŸ“˜ A text based explanation is available at: https://studyalgorithms.com Code on Github: https://github.com/nikoo28/java-solutions/blob/master/src/main/java/leetcode/hard/TrappingRainWater.java Test-cases on Github: https://github.com/nikoo28/java-solutions/blob/master/src/test/java/leetcode/hard/TrappingRainWaterTest.java πŸ’» Get Social πŸ’» Follow on Facebook at: https://www.facebook.com/studyalgos Subscribe to RSS feeds: https://studyalgorithms.com/feed/ Join fan mail: http://eepurl.com/g9Dadv #leetcode #programming #interview

Download

1 formats

Video Formats

360pmp439.9 MB

Right-click 'Download' and select 'Save Link As' if the file opens in a new tab.

Trapping Rain Water (LeetCode 42) | Interview Essential | Full visual solution | NatokHD