Neetcode 14/150 - Trapping Rain Water
October 14, 2024

Intro

This is entry 14/150 in the NeetCode150 Challenge.

The associated video is here:

Software Development | Neetcode Challenge 14/150 - Trapping Rain Water

Status

Problem

Here is the link to the Leetcode problem:

Leetcode 42

First LC hard problem.

Root Cause Analysis

I failed this module entirely. Not only did I not get a SINGLE test case, I didn’t even identify the correct use of the max() function. I was so hung up on attempting to find the correct algorithm in the allotted time I didn’t even think about utilizing this function.

There are SOME positives from this module, however. I didn’t code anything until I knew the algorithm was correct. I have been complaining that I do not do this enough, and when I took the time to try and map the pointers in Excel, I appreciated the fact I told myself that code is worthless without the working algo.

The entire video is me trying to figure out the algo. Hopefully someone can use that to their advantage.

Summary

Failed everything. Wow.

Action items

  1. Get more familiar with min/max problems.

Final thoughts

This was my first Leetcode hard. I failed it but I don’t think it was an entire failure. Talking out the algorithm and seeing where it failed was quite satisfying. Code less and think more should be my approach from here on out.

It sucks I didn’t solve this in the required timeframe. I cannot imagine this on a job interview.

Stream info

I stream these Neetcode problems on Twitch and have the recordings on YouTube. You can watch me attempt this module or follow me on any of the links below.

👇

Twitch

YouTube

This work is licensed under CC BY-NC-SA 4.0