Hey everyone. I’d like to share a pretty popular Dynamic Programming algorithm I came across recently solving LeetCode Explore problems. It’s super cool. The algorithm asks us, given n (which is the staircase number/step), how many ways can we reach it taking only one or two steps at a time? Here is the video…

# Category: Code Challenges

## Rotate a Matrix: With New Array (Python)

Hello everyone. I have another algorithm for you all today. One I’ve been meaning to tackle for a while now. La rotation d’une matrice…Rotation of a Matrix! I have two versions for you all, both in Python. This post makes a copy of the original matrix and adds the correct values to it, the second…

## Number Of Islands Tutorial (Python)

Hey everyone, glad to finally get this tutorial out to you all. I know I’ve been stating this for months now but I finally re-visited the question the other day and it was a lot less intimidating than when I had first seen the algorithm last year. I hope to simplify it for you all….

## Stack of Plates ~ Cracking the Code (Python)

Hello everyone, today I am showing you a Stack question out of Cracking the Coding Interview. The question is 3.3 in the Stacks and Queues chapter. I discovered this implementation on-line and commented it for better understanding. The video below is also an explanation of the process. The stack of plates question basically asks that,…

## Sort Stack Python~ Cracking the Code

Hello, Everyone. I solved an algorithm in Cracking the Coding Interview a few days ago and thought i’d share my code since I could only find one partial Python implementation online. The first video below shows a visualization of what is expected. The second video is of me explaining the concept and implementing the code….

## Round 4 Coding Challenge (Incomplete)

Hey readers, It has been two months since my last post. I am ending this challenge to begin a new one. Since my last post for round 4, I’ve only: Completed about 5 algorithms(on Code Wars) Applied to 145 jobs (in all rounds combined) Interviewed with Sparkbox (made to final round) Received a coding assignment…

## Busiest Time in the Mall – Python

My 3rd question from Pramp. The Westfield Mall management is trying to figure out what the busiest moment at the mall was last year. You’re given data extracted from the mall’s door detectors. Each data point is represented as an integer array whose size is 3. The values at indices 0, 1 and 2 are…

## Coding Challenge (Round 3)

Dang, so it’s been a month (I think) from my last blog post, but I reached my goal of solving 100+ algorithms a little over a week ago. If you count the mock interviews it would be 110. Honestly, this week I’ve been slacking. I think i’m burnt out. Here is the YouTube video for…

## Sentence Reverse – Python

This was the question I received in my first ever Pramp interview. I failed terribly at it, but now it seems so easy. #progress Input_array = [ ‘p’, ‘e’, ‘r’, ‘f’, ‘e’, ‘c’, ‘t’, ‘ ‘, ‘m’, ‘a’, ‘k’, ‘e’, ‘s’, ‘ ‘, ‘p’, ‘r’, ‘a’, ‘c’, ‘t’, ‘i’, ‘c’, ‘e’ ] Output_array = [ ‘p’,…

## Decrypt Message (Python)

This is one of the problems I received on Pramp. For this problem we are acting in reverse. We are given the steps on how to encrypt a word, but we have to figure out how to decrypt it. First we create a function called “decrypt”, then we set a variable, “prev” to 1. We…

## One Edit Away Python

This is a challenging one and a Dynamic Programming problem. This was also in Cracking the Coding Interview, the strings chapter. What this question calls for is to check whether a word is only one edit away from another word. For example bike, pike == True Mall, Malls == True blew, blue == False aale,…

## Compress a string (Python)

Hello everyone! Today I will be breaking down the algorithm to compress a string. For example Given: “aaabccccd” Should return: “a3b1c4d1” First, we define a function called “compress” with one argument, “string”. Next, we set a new variable, “res”, to an empty string so that we can add the final result to it. We set…