- Published on
Leetcode 383 - Ransom Note (Typescript)
Today we will be going over Leetcode 383 - Ransom Note. This is another example of using hash tables.
Today we will be going over Leetcode 383 - Ransom Note. This is another example of using hash tables.
With several hable table problems under our belt, lets do a slightly more difficult problem with Leetcode 525 - Contiguous Array.
Let's work on a slightly more advanced hash table problem today with Leetcode 1189 - Maximum Number of Balloons.
Today we will be using hash tables to find the largest unique number in an array in Leetcode 1133 - Largest Unique Number.
Today we will be going over Leetcode 2225 - Find Players With Zero or One Losses. This is a hash table problem that requires us to keep track of the number of wins and losses for each player.
Today we will be going over Leetcode 1426 - Counting Elements. This is a fairly classic hash table problem.
Let's continue our trend of working hash table problems by solving Leetcode 268 - Missing Number.
After several days of reviewing prefix sum and sliding windows problem, I feel it's a great time for a change of pace. Today (and over the course of the next few days) we will start to discuss using hash tables. Hash tables are a common data structure used in algorithms and competitive programming to solve counting-like problems. The advantage is that by iterating once through our input we create a dictionary that can be used to iterate through later on in a problem. We should get plenty of practice on this the next several blogposts!
Today we will be going over Leetcode 2090 - K Radius Subarray Averages. This is a slightly more advanced problem that requires the usage of the prefix sum technique.
Today we will be going over Leetcode 1480 - Running Sum of 1d Array. Our problem is a bit unique in that it really is just an introduction to the concept of using prefix sums. As such, this will be a relatively short post. But it will serve as the basis for a lot of problems we will see in the future. Prefix sums are a very common concept in competitive programming and algorithms in general. The prefix sum technique is the idea to take a list of numbers, and transform it such that each number in the list it the cumulate sum of itself and all the previous numbers in the list. This is a unique property that can help us make certain problems that would normally take O(n^2) time take O(n) time. Thats a big difference!
Today we will be going over Leetcode 1413 - Minimum Value to Get Positive Step by Step Sum. In a previous blogpost we discussed the concept of prefix sums. Today we are going to have a chance to implement this concept in a real problem!
Today we will be going over Leetcode 643 - Maximum Consecutive Ones III. Yet again we will be leveraging the sliding window approach for this problem.
Today we will be going over Leetcode 643 - Maximum Average Subarray I. This will be one of many sliding window problems we will be going over the next few weeks (and further on because, hey, there are a lot of them).
Hello! Let's continue our trend of working on two-pointer algorithms. Today we will talk about how to return an array of sorted squares in Leetcode 977 - Squares of a Sorted Array
Hello and welcome to another algorithm problem review! Today we will talk about a simple algorithm on how to reverse a string in Leetcode 206 - Reverse Linked List
In my previous blogpost I discussed how palindromes are a great way to dip one's toes into algorithms. But an even simpler start is to work with an anagram. An anagram is a word that is formed from another using the original letters exactly once. So how would we go about determining whether one word is an anagram of another? Let's talk through how to solve Leetcode problem 242 - Valid Anagram.
Palindromes are among some the most common "entry level" algorithm problems. Specifically they are a great way to test for understanding of basic approaches to solving problems with strings and arrays. Let's talk through how to solve Leetcode problem 125 - Valid Palindrome.
Today let's take a look at Leetcode problem 20 - Valid Parentheses
Today we will be going over Leetcode 701 - Insert into a binary search tree. This is a classic DFS (depth-first search) problem we will implement using recursion.
Today we will be reviewing Leetcode 103 - Binary Tree Zigzag Level Order Traversal which provides a good use case for breadth first traversal (BFS) of a tree.
Today we will being going over Leetcode 111 - Minimum Depth of Binary Tree. This is a classic DFS (depth first search) problem we will implement using recursion.
Let's take a look at yet another classic in-place array problem with LeetCode 88 - Merge Sorted Array
Let's take a look at a classic in-place array problem with LeetCode 27 - Remove Element
It's time to mix an array problem with some light dynamic programming in LeetCode 121 - Find Numbers with Even Number of Digits
Hello there! Today we will continue our journey into linked lists with Leetcode 203 - Remove Linked List Elements. This is a quite common question to solve with regards to efficiently removing nodes from a linked list.
Hello and welcome to another algorithm problem review! Today we will continue diving down the linked list rabbit hole to discuss Leetcode 206 - Reverse Linked List
After a rash of string and array problems I thought we would take a break today and start discussing linked lists. To start out let's take a closer look at Leetcode 141 - Linked List Cycle
We continue looking into array problems with LeetCode 1295 - Find Numbers with Even Number of Digits
I am back after a brief hiatus! Over the next several posts we are going to cover some very common array problems. Let's start with LeetCode 485 - Max Consecutive Ones
It's been a lot of fun completing one algorithm problem a day! I feel there is plenty time to go but I firmly believe given enough variety (and time) I will better master critical concepts. We previous have worked on two sum and atoi() which involve some clever tricks and helper methods that JavaScript provides. Today we are going to talk about something a little different and start dipping our toes into the concept of recursion and iterative solutions with leetcode 70 climbing stairs.
atoi() is a very classic C library function that converts character string into an integer. Otherwise if it is unable to do so it returns the integer 0. Now of course if you've visited Mozilla's famous MDN website to get help on web technologies atoi conspiculously returns no results. Because as it turns out we have other methods/practices for converting numbers to string (and vice versa). But to me the real challenge of this problem is not necessarily figuring out how to convert a string to a number but rather all the corner cases one must consider to implement an atoi() function in JavaScript.
As I mentioned in my about me section I do not have a traditional CS degree. My background consists of being a former semiconductor test engineer with a MS in Electrical Engineering and a Bachelors in Applied Mathematics. I have learned so much in the past one and a half years as I have continued to build things.
That being said I feel at this point there is a strong need for me to work on the data structure and algorithm fundamentals I never learned. So over the course of the remainder of the year I will be digging into many of these topics and as I write solutions (this example is Leetcode based) I hope to share with you my thought process and code.