Trapping Rain Water | without stack | Made Super Easy | Leetcode 42 | codestorywithMIK
Whatsapp Community Link : https://www.whatsapp.com/channel/0029... This is the 4th Video of our Playlist "Arrays 1D/2D: Popular Interview Problems". In this video we will try to solve a very famous problem : Trapping Rain Water | without stack | Made Super Easy | Leetcode 42 | Leetcode codestorywithMIK I will explain the intuition so easily that you will never forget and start seeing this as cakewalk EASYYY. We will do live coding after explanation and see if we are able to pass all the test cases. Also, please note that my Github solution link below contains both C++ as well as JAVA code. Problem Name : Trapping Rain Water | without stack | Made Super Easy | Leetcode 42 | Leetcode codestorywithMIK Company Tags : Accolite, Adobe, Amazon, D-E-Shaw, MakeMyTrip, Microsoft, Payu My solutions on Github(C++ & JAVA) : https://github.com/MAZHARMIK/Intervie... Leetcode Link : https://leetcode.com/problems/trappin... My DP Concepts Playlist : • Roadmap for DP | How to Start DP ? | Topic... My Graph Concepts Playlist : • Graph Concepts & Qns - 1 : Graph will no m... My Recursion Concepts Playlist : • Introduction | Recursion Concepts And Ques... My GitHub Repo for interview preparation : https://github.com/MAZHARMIK/Intervie... Instagram : / codestorywithmik Facebook : / 100090524295846 Twitter : / cswithmik Subscribe to my channel : / @codestorywithmik Summary : This code implements the trapping rain water problem using a two-pass approach. The `trap` function calculates the amount of water that can be trapped between the bars given their heights. It first computes two arrays: `leftMax` and `rightMax`, which store the maximum height encountered from the left and right directions respectively, up to each index. Then, it iterates through each bar and calculates the amount of water that can be trapped at that position by taking the minimum of the left and right maximum heights and subtracting the height of the current bar. Finally, it sums up these amounts for all bars and returns the total trapped water. In summary, the algorithm computes the left and right maximum heights for each position in linear time, then calculates the trapped water for each bar in a single pass, resulting in a time complexity of O(n), where n is the number of bars. ╔═╦╗╔╦╗╔═╦═╦╦╦╦╗╔═╗ ║╚╣║║║╚╣╚╣╔╣╔╣║╚╣═╣ ╠╗║╚╝║║╠╗║╚╣║║║║║═╣ ╚═╩══╩═╩═╩═╩╝╚╩═╩═╝ Timelines 00:00 - Introduction #codestorywithMIK #coding #helpajobseeker #easyrecipes #leetcode #leetcodequestionandanswers #leetcodesolution #leetcodedailychallenge #leetcodequestions #leetcodechallenge #hindi #india #coding #helpajobseeker #easyrecipes #leetcode #leetcodequestionandanswers #leetcodesolution #leetcodedailychallenge#leetcodequestions #leetcodechallenge #hindi #india #hindiexplanation #hindiexplained #easyexplaination #interview#interviewtips #interviewpreparation #interview_ds_algo #hinglish #github #design #data #google #video #instagram #facebook #leetcode #computerscience #leetcodesolutions #leetcodequestionandanswers #code #learning #dsalgo #dsa #newyear2024

3Sum Closest - (Meta, Amazon, Microsoft, Oracle)➕Live Coding 🧑🏻💻

L8. Trapping Rainwater | 2 Approaches | Stack and Queue Playlist

Trapping Rain Water II | Deep Dive Explanation | What | Why | How | Leetcode 407 | codestorywithMIK

L74. Trapping Rainwater Problem | Optimal Solution & Code

Stop Vibe Coding Apps - Do this instead!

I'm an ex-Google interviewer. You're doing LeetCode wrong.

Trapping Rain Water - Google Interview Question - Leetcode 42

Trapping Rainwater Problem – Brute Force and Optimized Two-Pointer Approach Explained

3 SUM | Detailed Explanation | Leetcode 15 | codestorywithMIK

Trapping Rainwater | Brute | Better | Optimal | with INTUITION

Ex-Google Recruiter Explains Why "Lying" Gets You Hired

9 Rain Water Trapping

Why The Russian Accent Terrifies Everyone

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

Trapping Rain Water Problem ( LeetCode #42 ) Part-1 | FREE DSA Course in JAVA | Lecture 72

The Game You Can't Fail

A Jane Street Software Engineering Mock Interview with Grace and Nolen

I Analyzed 3,800 LeetCode Problems. Only 8 Patterns Matter

