This is the medium-level problem with simple intuition and easy to visualize the problem. Here’s the link. https://leetcode.com/problems/furthest-building-you-can-reach/
Let’s think and solve together after you’ve read. To maximize the explanation, please try to think for at least 10 min.
The first thing you want to do is to narrow the problem. Basic intuition tells you to scan the building linearly, right? When we scan it, we can ignore all the cases that the current building is higher than the next building. You can jump down hoping you don’t break a leg. :D
You know that you have two options each…
I came across this problem on LeetCode about string.
You are given a string
s that consists of only digits. Check if we can split
s into two or more non-empty substrings such that the numerical values of the substrings are in descending order and the difference between numerical values of every two adjacent substrings is equal to
s = "0090089"can be split into
["0090", "089"]with numerical values
[90,89]. The values are in descending order and adjacent values differ by
1, so this way is valid.
s = "001"…
Have you ever read the news about successful people and wondered why you couldn’t be as much as them? I felt bad sometimes. I felt worse when I read about people younger than me are already doing something great and they are praised by the society. Compared to them, I feel like I am nothing and I did nothing really mattered.
Even when I judged myself alone without comparing to others, I always felt like I was a loser. I got no money. I got no accomplishment. I got no recognition. I don’t even have a degree.
So, let’s figure…
It is tough being a leader. It is even tougher when all your team members look up to you. You are the one who is calling all the shots. I felt like I had great power. Of course, with it comes great responsibility.
The theme of the hackathon is
Hack and develop a tangible tech solution that will help some segment of the Myanmar population learn how to manage their finances by using a formal financial service and/or to educate them on financial literacy.
We had a few ideas prior to the hackathon. The idea was to develop FAQ bot…
In Myanmar, most people use Zawgyi font by default in both mobile and desktop browsers. Only a handful of tech-savvy people use the Unicode. As a developer building the websites for Myanmar end users, I need to make sure the website is displaying Zawgyi font by default. As a tech guy, I can’t omit Unicode option.
As I am working for a brand new redesign from scratch, I want to detect the user is using zawgyi or unicode so that I can reduce the locale button to only two, English and Burmese.
The basic idea to detect is to measure…
Over the past few weeks, I was in soul searching journey. I was more confident than ever in software development as I could accomplish some small feats. However, I did not become happier with my code. Though I still am amused at solving bugs and doing some crazy stuffs, I felt something was missing.
I just decided to give up linear algebra course because I couldn’t give enough time any more and it was quite hard for me. These are knowledge I can’t learn without a consideration amount of quality time.
Or maybe I haven’t learned a skill to learn…
It’s been a year since my very first post on Medium. It was about how I would prepare myself to become a competitive programmer. Looking back, I was super stupid!? The funny thing is I still don’t think I am smart enough to get a great career in software industry. I am still stupid and trying to make everything sense even though it is literally impossible. In a year, I completed 5 algorithms courses on Coursera. I will share what I did wrong.
You need to know Data Structures first. You don’t necessarily need to be expert in a selected…
You should read the above link if you are new to dynamic programming.
For Dynamic Programming the starting point is commonly the knapsack problem which you can read here.
The knapsack problem is quite fun. When I first saw knapsack problem, it’s with greedy approach. You pick the highest value/weight item and loop until it is full.
Greed is not always the best profit. You have to be dynamic.
I am going to write about a problem that I encountered in a Coursera course. The problem statement is as follows.
You must start with 1. The goal…
I am not joking this time. It’s been so long since I last wrote on medium. A lot of things changed since then. I deleted FB. I deleted LinkedIn. Most importantly, my focus shifted from competitive programming. Yeah, I do like it. I’d rather solve a puzzle than playing some kind of computer games because I suck at games. I just don’t want to give much time to be the best. I’d rather learn maching learning.
When reading back my posts, I don’t even understand what the hell I was writing about. I promise I would write in a very…
There is a wall of size 4xN in the victim’s house. The victim also has an infinite supply of bricks of size 4x1 and 1x4 in her house. There is a hidden safe which can only be opened by a particular configuration of bricks in the wall. In every configuration, the wall has to be completely covered using the bricks. Except from the problem statement.
Find all possible combinations for 4xN.
F(N) = F(N-1) + F(N-4)
I have searched the explanation for that formula. I was so depressed and sad that I could not understand it clearly. I didn’t give…