Searching Algorithm - (Q&A -5) - Trapping Rain Water Problem
Given n non-negative integers representing an elevation map where the width of each bar is 1, compute how much water it is able to trap after raining. This problem used to get asked in software engineering interviews for companies such as Google, Twitter, Apple, and Amazon to name a few. Input: { 3, 0, 2, 0, 4 } Output: 7 Input: { 0, 1, 0, 2, 1, 0, 1, 3, 2, 1, 2, 1 } Output: 6 ***************************** Difficulty: Medium Topic: Searching Algorithm DS: Array | 2 pointers Company: FAANG ***************************** Code: https://bit.ly/2Ds1iBa [IMPORTANT] Complete List of interview questions that you need to prepare: https://bit.ly/34HXbMI In this video we will see how to find the solution for trapping rain water problem **This video comes under "MEDIUM" section of interview questions. Q1: Find duplicate element in a given array: Q2: Separate odds and even numbers in a given array: Q3: Segregate 0's 1's and 2's in an array: Q4: First occurrence of a number in a sorted array: Q5: Trapping Rain Water Problem: Q6:Smallest Missing Number in sorted array: Q7: Zero Sum Subarray Problem: Q8: Number of rotation in a circular sorted array: Q9:First non repeating character in a string: Q10: Longest Substring Without Repeating Characters: Q11: Find Triplets In Array With Given Sum: Q12: Max Contiguous Subarray Sum ( Kadane's Algo ): #interviewWithBunny #codinginterview #crackingthetechnicalinterview Social Connect: LinkedIn: https://www.linkedin.com/in/anindya-sankar-dasgupta-39a315ba/ Facebook: https://www.facebook.com/anindya.s.dasgupta Instagram: https://www.instagram.com/anindya_bunny/ Medium: https://bit.ly/3loMzsa FB page: https://www.facebook.com/technicalinterview03/ Telegram: https://t.me/TechnicalInterview_official Additional tags: trapping rain water nick white leetcode 42 trapping rain water trapping rain water two pointers trapping rainwater leetcode solution trapping rainwater problem leetcode trapping rain water java trapping rainwater problem leetcode trapping rain water 2 leetcode trapping the rain water trapping rain water 2
Download
1 formatsVideo Formats
Right-click 'Download' and select 'Save Link As' if the file opens in a new tab.