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…