There is a way to make it easy.

Sometimes they make it look hard, while in fact, there’s always a way you can easily understand. Today, we’ll crack leetcode 22 — Generate Parentheses— together. After this article, you’ll have a better understanding of Back Tracking. Without further ado, let’s get started.

Problem Description:

Image for post
Image for post

There is a way to make it easy.

Sometimes they make it look hard, while in fact, there’s always a way you can easily understand. Today, we’ll crack leetcode 401 — Binary Watch — together. After this article, you’ll have a better understanding of Back Tracking. Without further ado, let’s get started.

Problem Description:

Image for post
Image for post

There is a way to make it easy.

Sometimes they make it look hard, while in fact, there’s always a way you can easily understand. Today, we’ll crack leetcode 198 — House Robber— together. Without further ado, let’s get started.

Problem Description:

Image for post
Image for post

There is a way to make it easy.

Sometimes they make it look hard, while in fact, there’s always a way you can easily understand. Today, we’ll crack leetcode 3 — Longest Substring Without Repeating Characters— together. Without further ado, let’s get started.

Problem Description:

Image for post
Image for post


There is a way to make it easy.

Sometimes they make it look hard, while in fact, there’s always a way you can easily understand. Today, we’ll crack leetcode 653 —Two Sum IV: Input is a BST — together. Without further ado, let’s get started.

Problem Description:

Image for post
Image for post

There is a way to make it easy.

Sometimes they make it look hard, while in fact, there’s always a way you can easily understand. Today, we’ll crack leetcode 21 — Merge Two Sorted Lists — together. Without further ado, let’s get started.

Problem Description:

Image for post
Image for post

There is a way to make it easy.

Sometimes they make it look hard, while in fact, there’s always a way you can easily understand. Today, we’ll crack leetcode 35 — Search insertion position — together. After this article, you will learn or refresh your memory about Binary Search. Without further ado, let’s get started.

Problem Description:

Image for post
Image for post

There is a way to make it easy.

Sometimes they make it look hard, while in fact, there’s always a way you can easily understand. Today, we’ll crack leetcode 121— Best time to buy and sell stock — together. Without further ado, let’s get started.

Problem Description:

Image for post
Image for post
(photo taken from Leetcode: https://leetcode.com/problems/best-time-to-buy-and-sell-stock/)

This problem is actually asking, what’s the maximum profit you can expect, when you know all the stock prices in this time period.

Solution:

Solution #1. Dynamic Programming:

I didn’t come up this, but I thought it’s worth sharing, so I listed it here as first solution:


There is a way to make it easy.

Sometimes they make it look hard, while in fact, there’s always a way you can easily understand. Today, we’ll crack leetcode 15 —Three Sum — together. Without further ado, let’s get started.

Problem Description:

Image for post
Image for post

There is a way to make it easy.

Sometimes they make it look hard, while in fact, there’s always a way you can easily understand. Today, we’ll crack leetcode 1 — Two Sum — together. Without further ado, let’s get started.

Problem Description:

Image for post
Image for post

About

Christina Lalay

Life is beautiful!

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store