Posts

Beware of blind …

Introduction

I ran into this problem for an initial assessment and found myself short on time. I was comfortable with a fairly similar problem in container with most water however wasn’t sure if the way I was “extending” the problem was correct. Unfortunately after finding the …

Choose Unchoose Pattern …

Recognizing the Pattern

In this part we’ll just focus on how to better recognize this pattern as well as variations in the code that show up.

Regular Power Set

Let’s say the set is:

A = {1, 2, 5}

To find the power set of A, we need to find all possible subsets of A. The power set of A …

Coin Change

Intuition

https://labuladong.gitbook.io/algo-en/iii.-algorithmic-thinking/detailsaboutbacktracking#permutation

The Problem

You are given an integer array coins representing coins of different denominations and an integer amount representing a total amount of money. Return the fewest number of coins …

Processing Tax (Graph …

Goal

The goal of this blog is to discuss graph traversal algorithms and give a little more intuition between the flow of the actual code. The blog assumes you are already familiar with Breadth First Search (BFS) and Depth First Search (DFS) algorithms. I would always forget when do you add a node to …

Countdown Pattern

Introduction

This pattern is pretty rare but it’s easy to spot once you recognize it. Let’s take a look at two problems that have this pattern. It does not improve your time or space complexity but it makes the overall approach to the code a litte simpler.

Koko Eating Bananas …

Reorganize String

Introduction

The patterns that you run into for this problem are pretty interesting which makes it slightly challenging to understand how to iterate through when you code up the solution. It’s a placement problem.

Transforming the input

In this case the input is not actually helpful and if …

Choose Unchoose Pattern …

Introduction

This is part two of my discussion on the choose unchoose pattern found in programming interview questions. This post will specifically focus on the loop aspect of the pattern. We will use the Combination Sub problem as the application to the concepts.

Understanding why a loop also works …

About

  Welcome to my page. How you got here I have no clue but I hope it can be of service to you in some way. My goal for this page is to discuss some concepts that I think are of value. Short and sweet posts that expand or introduce you to topics that I stumbled on. After some time I've learned to …

Stable Sort = Complex …

Introduction

Sometimes you learn the hard way in life. Con is that there was a potential cost. On the plus side you will likely not forget it. In today’s topic is brought to you by me taking twice as long to complete my interview assessment and potentially failing it for that reason. So the …

01 Matrix (BFS with …

Introduction

We’re taking a look at 01 Matrix on Leetcode today. The main motivation is to realize that when using BFS you can start with multiple sources instead of a single source. This just means that even though we usually start out with a “root” and do BFS from there, you can …

Insert Interval

Introduction

Today we’ll take a look at Insert Interval. The reason why I think this is a useful problem to learn is because it helps you approach these problems in such a way where the code is more intuitive. Essentially the reasoning behind this problem and others like it is that it is not …

01 Matrix (Solving DP by …

Trouble

Even if you traverse the node wouldn’t you need to traverse the node for every node. For each node we’d need to determine the distance by traversing it? Multiple traversals are costly

A Dynamic Programming solution comes into play. Ask your neighbor what is the distance to 0 from …