Friday, July 20, 2018

Leetcode 202: Happy Number

July 20, 2018

Introduction


It is easy level algorithm. I had good time to rewrite the algorithm in less than 30 minutes.

My practice 


Here is my C# code.


Leetcode 190. Reverse Bits

July 20, 2018

Introduction


It is an easy level algorithm related to bit manipulation. I just could not believe there are some good ideas to learn this time again.

My practice 


Here is my C# practice. I just could not how much fun I had to work on the algorithm again. I have not written bit manipulation long time. Nervous, frustration, and then confusion, and so happy to find one blog with so clear explanation. It is learning experience, I just could not believe that a software programmer needs to practice the bit manipulation algorithm very often.


Thursday, July 19, 2018

Cracking the facebook coding interview - the approach

July 19, 2018

Introduction


I searched google and then I came cross this slideshow. Here is the link. Here is the handout.

I like to write down a few lines of notes for the video talk prepared by Gayle.

Notes

Design question


Scope - scope the problem -> ask question, make appropriate assumptions
key components -> can be somewhat naive
Identify -> Issues -> bottlenecks, tradeoffs
Repair & Redesign

Discuss top -> down


Push yourself

34:51/ 1:47
When I ask you a question, my assumption is that you do not know how to solve it. You will be comfortable to seeing a problem, being hard, and finding techniques to make progress.

If you practice, the technique is to look up the back of the book. You will be out-of-luck in the interview. So really feel the comfortable to push yourself. (35:12)

It is not quantity game. It is about quality. Spend time to push yourself. It is hard, find techniques to make progress.


Resources

Here is the link of page on crackthecodinginterview.com resource page.





3 benefits to write easy level algorithms on Leetcode.com

July 19, 2018

Introduction


It is Thursday night, 10:06 PM. I like to spend 20 minutes to do a small research on working on Leetcode easy level algorithms.

I do not have a habit to write code every day. When my ex-coach told me this Tuesday that I should write 10 easy level algorithm a day, 10 to 15 minutes on one algorithm. Write 70 to 80 easy level algorithms first.

It is time for me to listen to my coach. He told me before June 6, 2018 when he coached me 10 session. I know that I am stubborn. It is not easy for me to accept the new idea, even though he was my coach. I did not practice and submit easy level algorithms.

30 minutes research


First of all, this is the idea from my ex-coach, write easy level algorithm every day. Why I need to write code every day, 10 to 15 minutes for one easy level algorithm?

I know that I have a bad habit first five years working on my current employer. Every time after the work, I stay at home, I may spend more than 30 minutes to read wenxuecity.com, or spend over one hour on wechat.com.

Here is the question on quora.com about "How do top programmer choose problems in online judges that improve their problem solving skills?". I plan to read as many answers from this ICPC world finalist who gave 119 answers.

I know that easy level algorithm is very good warmup, good for my brain and I can learn how to control my nerves very well through those algorithms. Online judge is a really good tool to challenge me to think hard and solve problems reported by online judge.

I will be very humble right away since I will have problems to solve easy level algorithms.

Last few days I solved two easy level algorithms. Both are my favorite ones.



Follow up 


July 30, 2018

It is time for me to understand how a person can perform 10 times better compared to myself. I can train myself using easy level algorithms.

I will see myself perform up and downs. Either within 5 minutes with eaze or struggling over 30 minutes, I will learn and improve and become a strong programmer in the long run.

It is time for me to focus on more on crafting skills, test cases, edge cases, and be able to read, think, learn the algorithm every day.

Wednesday, July 18, 2018

Leetcode 438. Find All Anagrams in a String

July 18, 2018

Introduction



It is easy level algorithm related to find anagrams in sliding window. The problem can be solved using counting sort and dynamic programming. It is so nice experience to write a C# solution using less than 20 minutes.


My practice



I quickly fixed the issue since online judge reported the errors.

Here are the highlights of issues found:

1. Line 42, need to add extra checking in the second condition: (pLength + i - 1) < sLength
2. Line 45, missing - 'a' to convert to integer
3. Make sure on Line45 string s access of index is in the range, so (pLength + i - 1) < sLength is added. Think about i = 1, end position is pLength - 1, and then think about start position from i and end position pLength + i - 1. (i, pLength + i - 1) covers pLength's chars.

Here is c# code:


Leetcode 125

Leetcode 301: remove invalid paretheses

July 18, 2018

Introduction


It is hard level algorithm and I have to review the algorithm first. Most of important is that I have to understand how to write working code, and then pass online judge. I reviewed one of submissions I did more than 6 months ago.

Most of important is to write a story how to solve the problem using test case "()())()". I found this test case through my last submission. I have to explain my solution based on this test case.

Story first, code follows


I have to write a story how to work on the test case, I have to write a story. And then I need to conduct time complexity as well.

I put the story in the function specification. I reviewed the code and made some changes.


Here is the code.


Explain how I will solve the problem using test case "()())()", and the valid strings are "()()()" and "(())()".

And based on the test case, explain the time complexity of the algorithm. For example, first part of string is "()())()", second part is same string, how many valid strings we have.



Follow up


July 20, 2018

In order to figure out time complexity, I like to work on the test case with string ()())() repeating twice like ()())()()())(). How many valid string can we generate?

Based on my last practice, the string ()())() is removed extra close parathese and there are two valid strings. One is ()()() and another one is (())().

For first valid string ()()(), concatenated by ()())(), how many valid strings can be generated?
()()()()())()
       
When I work on the extra close paratheses, there are five options to remove ). So there are five valid strings:

(()()()())()
()(()()())()
()()(()())()
()()()(())()
()()()()()()

so in total there are 10 valid strings.

We like to find the upper bound of number of valid strings. Each substring ()())() has two valid string, but the concatenation of two generates 10 valid strings, not just 2 * 2.

I used to be math major. I like to figure out the upper bound. I do like to get more experience on a concrete example. My understanding is that I may have barrier to think clearly about the problem since I do not have any good experience on one test case.

It is time for me to build a good test case and write down some learning here.


Try to explain 



There is new case to remove extra close paratheses. In the first string, two extra paratheses instead of one can be removed. We know that ()())() string at least one close parathese should be removed.

The extra user case explains there are extra 6 valid string available after concatenating two strings. There are three options to remove two close parentheses.

Leetcode 493: Reverse Pairs

July 19, 2018

Introduction


It is a hard level algorithm called reverse pairs. I like to write code for the algorithm.

Leetcode 387: First unique character in a string

July 18, 2018

Introduction


It is an easy level algorithm. But I could not believe so many mistakes I made in my code. I spent over 20 minutes to try to fix the bugs. It is not easy for me to write an easy level algorithm after a few months break.

Continuously writing three algorithms in a row is such a fantastic job to do. I have not experienced this long time.


My practice 


Here is my C# code.



Leetcode 273: Integer to English Words

July 18, 2018

Introduction


It is hard level algorithm. I had some discussion with a peer through mock interview more than three months ago. But I did not write code and did not submit anything through Leetcode online judge.

I know that it is important to write working code and pass online judge. And also I need to work hard to submit as many algorithms as  I can. The number cannot lie.

I have to submit code through Leetcode online judge, I like to demonstrate how hard I work on the practice. So I tried very hard to put together code today.

I like the effort I spent on the algorithm, although I still spent over 45 minutes to write code. I like to encourage myself to write more code in short future.

Every algorithm counts


It is best time for me to write a hard level algorithm when I have doubt for myself. I had good time to write code but there were so many mistakes in my code. I had to work on the bug fix depending on Leetcode online judge.

There are more than five places I stumbled this time since I had not written code a lot last few months.

Here is my C# code.

1. Line 19: Forty spell error: Fourty
2. Line 30, forgot to declare a variable called workingNumber,
3. Line 45, I did not reduce workingNumber to a smaller number first writing
4. Line 50, I tried to simplify the code, always a space is added
5. index out of range error, line 66, current is bigger than 1000 in my first running
6. current / 100 -> I wrote current % 100 at the first time, the bug was fixed
7. Line 77, biggerThan19 variable for the case is forgotten in my first writing


Life is so simple when I work hard to write code for a medium level algorithm. I just keep writing code and follow my coach's advice.

Time spent:

More than 30 minutes

My last practice is in the mock interview in March 2018. Here is the blog.

I just could not believe that I did not submit any code after March 2018 mock interview. It is important to get some training through Leetcode online judge.

Facts


As of July 18, 2018, solved 101/861, accepted submission: 759/511, Acceptance rate: 50.7% based on my Leetcode profile:
https://leetcode.com/jianminchen39/

Leetcode 113: Path sum II

July 18, 2018

Introduction


It is the medium level algorithm called path sum II. It is my favorite recursive algorithm and I still spent over 15 minutes to work on the code.

My practice


Here is my C# practice. This is my first time I submitted the algorithm on Leetcode.com.

Easy level algorithm as corner stone

July 18, 2018

Introduction


It is true that I only have submitted 100 algorithms on Leetcode.com. I have not fully used Leetcode online judge to train myself.

It is most profitable business to do next two weeks. Practice as many as easy level algorithms as possible.

Great advice 


I should try to write an easy level algorithm on Leetcode.com, 10 to 15 minutes each, try to write over 10 easy level algorithms as possible a day.

Advice from my favorite ex-coach who has submitted over 500 Leetcode algorithms this past Tuesday July 17, 2018. Those 35 minutes talk will bring me back to reality, stay grounded and reduce time to social chat, and mock interviews, and focus on coding.

Great thanks to those working hard with submission over 500 Leetcode algorithms. It shows the determination, hard working spirit.  I want to be one of them in short future. I need to set a target for 120 algorithms first, right now I have submitted 100 algorithm only.

Facts


As of July 19, 2018, solved 101/861, accepted submission: 759/511, Acceptance rate: 50.7% based on my Leetcode profile:
https://leetcode.com/jianminchen39/

Here is the graph to compare my ex-coach with me on Leetcode profile:




I like to call the coach mindset as a champion mindset. Prepare, prepare, get prepared early. 

Tuesday, July 17, 2018

100 hard level algorithm 2018 summer campaign

July 17, 2018

Introduction


I like to have a campaign to study 100 hard level algorithm this summer to celebrate my eighth year on the software programmer job. Every hard level algorithm teaches me a lesson. I really appreciate the time and people involved to help me gain the experience.

Here is the github folder to contain the hard level algorithms I will select and document my learning experience.

Quora answer


I asked the question first and then wrote an answer on quora.com. Here is the link.

Leetcode 527: word abbreviation

July 17, 2018

Introduction


It is hard level algorithm called word abbreviation. It is the first time I spent time to work on the algorithm. Here is the gist I created for my study.


Leetcode 517: Super washer machine

July 17, 2018

Introduction


It is the hard level algorithm called super washer machine. The idea to solve the problem is kind of interesting. I like to study more later.


Here is the gist I created to help me understand the algorithm and learn an idea how to solve it.


Leetcode 514: Freedom Trail

July 17, 2018

Introduction


Every hard level algorithm deserve me 30 minutes. The algorithm is called Freedom Trail.


30 minutes study


Here is the gist I studied around 30 minutes.


Leetcode algorithms

July 17, 2018

Introduction


I like to spend one hour to go over those Leetcode algorithms. Leetcode 113, 125, 269, 301, 273, 387, 493, 721.




Sunday, July 15, 2018

Tennis WTA coach wim fissette

July 15, 2018

Introduction


It is time for me to study one coach named wim Fissette to help Anger Kerber to win grand slam Wimbledon 2018.

It is something I like to learn from the best coach in the world. I can tell that the coach is so difficult job to do.

A lot of videos to watch


Here is two minutes video, very good one to watch more than once.


Being aggressive was the key

July 15, 2018


Introduction


It is time for me to watch 20 minutes video from Anger Kerber, wimbledon champion. Here is the video link.

Notes


2:00/ 20:00 - Do  not think about too much. What will happen.

2:40 - Come back, without 2017, I could not learn so many things about myself; Make my day schedules. Find motivation after 2016. Such a year is impossible. Try to be a better tennis player, a better person. Try to enjoy the tennis again.

3:52 - She pushed me to the limits. To play final with her, ... Today I had to take the match at my hands.

5:28 - Being aggressive, playing my game.

6:02 - new coach brought about to her. One of keys is to serve good in important moments.

6:49 - play final with Serena. Not thinking too much. Stay cool. Do not show emotions. Going for that. It is not so easy to say. You can do your best.

7:44 - I am 30 years old. So many experience over the years. It helps me to relax. Focus on the match. You have to go through all the things. You have to learn.

10:00 - three grand slam. Play final second time here.

15 minutes break - 7 Can challenges video

July 15, 2018

Introduction


It is time for me to work on reading the book Elements of programming interview. I am kind of needing tea or things to stay alert after more than one hour reading. I like to watch Can challenge video of WTA, 7 videos for my favorite 7 players.

Here is the video link.

First break


It started from 12:40 PM - 1:05 PM, 7/15/2018.

Leetcode 277: Find the celebrity

July 15, 2018

I plan to work on the algorithm at least 30 minutes. I like to get the idea how to solve the algorithm in most time efficient method.


Saturday, July 14, 2018

Two hours coach

July 14, 2018

Introduction


It is so enjoyable to be a coach today on tennis court. I met three young Chinese again in front of tennis wall. I decided to coach two teenagers to play tennis, and also coached a young 23 years old UBC graduate how to play tennis on tennis court.

I have played tennis over five hundred hours and also paid so many coaches for so many private lesson. It is so easy for me to coach the young girl how to adapt tennis footwork, how to walk and run, communicate with the peer etc. It was so much fun for me to be a coach, the workout two hours were so happy and enjoyable.

It is so much fun to work with the young generation. I also talked about my nephew a 24 years old, my sponsor application. Summer time is so much fun to hang out on tennis court.


My six minutes warmup video using medicine ball: Dua Lipa

July 14, 2018

Introduction

It is time for me to find some good video for me to warm up before I go out to play tennis. I found one and also I like to play the video a few times today.

Here is the video link called Opening UEFA Champions League Final.

Summer reading: Elements of programming interview

July 14, 2018

Introduction

It is time for me to start to read the book called Elements of programming interview. I am looking for ways to improve my reading skills.


Summer reading: C++ code is my favorite

July 14, 2018

Introduction


It is so exciting for me to start to go over 500 Leetcode algorithms written in C++. I like to spend next two weeks to read C++ code. What I like to do is to read the problem statement, and then think about five to ten minutes, and read C++ solution.

My summer time bible


I used to call this solution as my bible for next three weeks. I like to go over the solution one by one again. I know that the hard working person will make his code as clean as always.

It is so busy summer time. I like to get some good reading material. Learning C++ from Leetcode solution definitely is also a good style.

Here is Leetcode solution written in C++.


Facebook algorithms

July 14, 2018

Introduction


It is time for me to go over those 70 asked algorithms by Facebook. This time I marked the repository on github.com using star. I like to go over those algorithms again.

One thing I like to do is to go over the notes prepared by this facebook engineer, and see how good she is compared to me. What I can learn from her? The way she organized the document is much better and it is so easy for me to follow her.

One algorithm a time


Here is the link for those algorithms. I like to go over those algorithm this Saturday.


Find a path with minimum maximum value in the matrix

July 14, 2018

Introduction


It is the extended algorithm and binary search algorithm can be applied. The most important is to lower down the time complexity to be controllable. I took the major hint from the mock interviewer and then we had discussion of time complexity. I did learn a lot from this mock interview.

Algorithm discussion


Here is the discussion transcript.


Actionable items


The peer gave me a few advice. Read two books, one is cracking code interview. One is elements of programming interview. And also we discuss how efficient we can do to have mock interview together, how often we can meet. The peer is in Asian country, I am in Canada.

The second advice is to get Leetcode subscription by month, $30/ month. There are a lot of similar algorithms discussed in those paid subscription.

We had discussion about Leetcode algorithm practice. The peer completed around 500 algorithms. But I have around 100 algorithms so far only.

Another discussion is to give each other 10 Leetcode hard level algorithms you have worked on since last meeting. And ask the peer to work on the hard level algorithm one by one in 5 minutes, and then give hint to help if the peer cannot solve. The peer said that it will not work for him.


Lessons learned


When I search the solution, I have to try to find the optimal time complexity as soon as possible. Please have an open discussion with the peer as early as possible. 

What is the brute force solution and time complexity? Can we lower the upper bound of algorithm?

For the algorithm to find minimum maximum value in the path, we have to find the range of value of matrix first, and use it to measure the time complexity of the algorithm. 


Statistics


Meeting time July 14, 2018 9:00 AM PST - 11:10 AM PST

First the peer worked on the infix expression to binary expression tree, and then I worked on the two algorithms, discussion of "Find a path with minimum maximum value in the matrix".


Find a path with increasing value given two nodes in the matrix

July 14, 2018

Introduction


I was given an algorithm to work on called find a path with increasing value given two nodes in the matrix.

10 minutes discussion


Here is the transcript for the discussion. The peer asked me to write code. I told him that I chose not to write code, and go for the extended algorithm.


Clone graph

July 14, 2018

Introduction


I spent 10 minutes to discuss clone graph algorithm with the peer. It takes some time for the peer to understand the requirement. We had discussion, the gist is here.


Infix expression to a binary expression tree

July 14, 2018

Introduction


It is the second meeting with a peer after six months. We met together this January 2018. And then I gave him the algorithm to work on which is to construct binary expression tree using infix expression.

Problem solving


The peer is very strong at coding skills, so he chose the optimal solution linear time O(N), and tried very hard to figure out how to design parsing algorithm using stack.

Here is the transcript how he approached the problem. I can tell that he is very smart on time complexity compared to me.


My feedback


The peer did very good to find optimal solution, try to use stack to parse the string once and build a binary expression tree. The time complexity is O(N), N is length of infix expression. And the peer communicated very well, there are multiple solutions and he decided to push the number and operator to the stack and also build a binary tree node in the same time. Somehow he should think about validation of expression string, and also try to simplify the code. 

Here is my feedback gist.




Statistics


Meeting time July 14, 2018 9:00 AM PST - 11:10 AM PST

First the peer worked on the infix expression to binary expression tree, and then I worked on the two algorithms, discussion of "Find a path with minimum maximum value in the matrix".


Follow up 


July 16, 2018


I wrote C# code to implement the algorithm using O(N) time complexity, N is the expression length. 

Meetup at 7:30 AM

July 14, 2018

Introduction


I had a meetup with the peer this morning at 7:30 AM. I usually did not get up so early. But I did because the peer complained that it is not easy to get mock interview on interviewing.io. I agreed to work with him and work on a few algorithms.

Problem solving

I did not save his code. But I did spend one hour 30 minutes to give him two algorithms to work on. One is to construct binary expression tree using infix expression tree, and the second one is to clone graph.


Actionable Items


I need to learn how to work with people with various background. Sometimes I can tell that peer is so nervous at the beginning because he lacks enough practice.

A friend just reminds me to work hard in the weekend. He originally likes to set up 6:30 AM.




interview advice

July 14, 2018

Introduction


It is good advice I read from a Chinese website written in Chinese. A software developer with more than 5 years experience shares his advice on the onsite interview.

Here is the gist I created. I have to figure out the ways to get good understanding of his advice.

A short version of advice


I like to be creative, fist I copy the note to the current blog and then reorganize it to a short version here.


Friday, July 13, 2018

Infix expression design

July 13, 2018

Introduction


I spent last two days to look into infix expression. I like to know how and why infix expression is designed to allow open and close bracket to help and make it easy to parse using a stack.

I like to google and then find out.

Follow up 

July 14, 2018 10:30 PM

I played tennis today and then I figured out something for my blog on tennis court.

I like to give a good name for this infix expression design.  It is most cheapest way to use extra space to get optimal time complexity.

To design infix expression just uses those extra open bracket and close bracket, cheapest extra space to allow smart programmer to apply linear time to parse the expression, just use a stack to apply the storage for those unprocessed expression.





30 minutes running so fast

July 13, 2018

Introduction


I like to write down some notes about the algorithm I spent 30 minutes to work on. The graph algorithm should be a simple and easy one to write, but somehow I did not test the graph algorithm very well.

I like to spend 10 minutes or so in short future to write down some test cases for a simple graph algorithm.

Clone graph 


I like to study the algorithm called clone graph.

infix expression to construct binary expression tree

July 13, 2018

Introduction


It is my favorite thing to do to scan the code qucikly in less than 15 minutes. Here is C++ for the algorithm.


Using stack


The really important tips are to use stack, so the time complexity can be implemented using O(n) time to parse the infix expression. And the binary express tree can be built in bottom up way. The similar idea using stack can be see in multiple places.

The ) bracket is used to determine when to pop the stack and handle the operand and also operator.


Here is the gist I created how to use stack to parse the infix expression and then construct the binary expression tree.

Here is the output of stack working on a simple test case:

My bet was wrong


 I knew that stack is used on reverse polish notation. And it is widely used to parse the input. There is a hard level algorithm Leetcode 301 to parse parentheses, I did write 10 blogs on that. I also did work on hard level algorithm using more than 10 ideas.

 But the performance on 30 minutes is beyond my control. I could not think clearly using stack and stop on close bracket ), and then start to pop and then construct binary express tree from bottom up.

 What I did is to think about finding operator (1 + 2) so that I can use the string manipulation to get the result. I am not aiming highest potential I can reach in those 30 minutes.

 Through the performance, I understood that it is very important for me to calm down, and list all the options I have. Stack or not using stack, what is time complexity? Can I beat other people to write an optimal time complexity solution.

 I still remembered that I practiced a hard level algorithm on hackerrank and learn the power of using stack. The algorithm is called Reverse shuffle merge.

Actionable Items


Review all past practice using stack.

Here is the first one, Leetcode 109: convert sorted list to binary search tree.

Review one of solution using O(n) time O(1) space, the link is here.



Follow up


Most important is to understand the space is cheap, using space to expedite the time is always best choice, need to scale the problem in large expression. This time I failed to give it a try in 30 minutes using stack to get linear time complexity.

Dua Lipa - See in Blue (documentary)

July 13, 2018

Introduction


It is less than 10 minutes video for me to learn from a singer, what is her thinking process to start her career starting from 15 years old. The video link is here.

I really like the singer and how good she expresses herself using such good statements. Specially a talk related to hard work.

Take some notes




infix to postfix expression study

July 13, 2018

Introduction


It is such a great topic for me to pick up after I spent 30 minutes to write a infix expression parser. I understand that it is so important to lower down time complexity to linear, the only way I can do is to convert to postfix expression, and then I will not need to spend time complexity O(N^2) on the algorithm.

How far I can go on this topic?


There are a few resources I can easily find. I like to choose three good reading material first.





binary expression tree study

July 13, 2018

Introduction


It is called binary expression tree. I really enjoy to spend a few hours on this topic and write a blog to document my study.

Here is the wiki article. I like to spend 10 minutes to read again and write down some notes here.


90 minutes mock interview sharing

July 13, 2018

Introduction


It was my Wednesday 10:00 PM mock interview, I am the interviewer and the peer is very experienced programmer who is preparing facebook onsite interview. He likes to share the interview on mock interview platform, I like to support his decision.

The interview is 90 minutes, 3 algorithms involved. We had very good discussion and I really like the interviewee, he wrote anything I suggested, and I never saw any one wrote so perfect code before.

Website 


There are less than 30 showcases on the site: https://interviewing.io/. Here is the image to help find the mock interview.



Home sick - a song I like to sing

July 13, 2018

Introduction


It is the first time I start to search singers I may like long time. I found one for my summer time, and here is the song called home sick. The singer is Dua Lipa.

I have to find some songs for my tennis workout. I need to work on my summer sports planning and get ready to spend more hours on tennis court.

Here is the song I like to learn next week, and here is the meaning of lyrics of To be the one.




Wednesday, July 11, 2018

What is my motivation to work hard?

July 11, 2018

Introduction


It is a small research topic I did on tennis sports. Professional tennis player and what he/ she believes.

Because one of professional tennis players takes too much time on commercial thing, other professional tennis players think that she will not succeed as other do.

More than 30 minutes chat


I had chat with my friend Emma and we talked about what is my motivation. Do I believe in hard work? Do I believe in luck? or superstitions?

We talked about Carpe Diem, um tatoos professional tennis player put on her hand.




Counting down 48 hours

July 11, 2018

Introduction


I like to train myself this time using 48 hours. I like to go over as many as possible algorithms and data structures in 48 hours range. It is good ideas to go over some Leetcode algorithms, my past practice on hackerrank contest. I like to see the difference this time.

My belief is that using easy level and medium level algorithms to warm up is most efficient way.


Yesterday once more

July 11, 2018

Introduction


I like to use Carpenter song to remind me how sweat the feeling is. Yesterday once more. I got contacted by a very good software company on July 10, 2018.

I documented the birth of my coding blog. Why I started to write coding blogs to help myself starting from January 2015.

Now three years are gone. I have chance to learn something new again. I am so excited.


Graduation season

July 11, 2018

Introduction


It is so enjoyable to congratulate my ex-coach graduated from Tsinghua university master degree yesterday through wechat.com.

I should write something here to celebrate the graduation. Maybe I should copy a few bible verse to make a very good blog here.

Searching ...

Life is a treasure box

July 11, 2018

Introduction


I just could not believe that life is a treasure box. I felt so good to got a message from a peer met more than six months ago. The peer likes to practice with me this weekend on algorithm and data structure problem solving. I just could not believe that he offered me to practice together. He won ICPC region contest before.

I put together a post on github.com. I learn to publish on github.com and see if there are something new to learn. Here is the link.


Count substrings with same first and last characters

July 10, 2018

Introduction

It is the algorithm I am trying to search through Google about contiguous substring. I am  trying to find the optimal solution, but I could not find it. So I decided to study one of post here:

Count substrings with same first and last characters

Tuesday, July 10, 2018

Leetcode 171. Excel Sheet Column Number

July 10, 2018

Introduction


It is an easy level algorithm in Leetcode.com. I plan to review the algorithm quickly.

Leetcode 88: Merge sorted array

July 10, 2018

Introduction


It is an easy level algorithm but I like to practice one more time.

Leetcode 41: First missing positive

July 10, 2018

Introduction


It is a hard level algorithm. I spent 10 minutes to read the solution, and also reviewed my practice this year. I will write down something for the algorithm here.


Leetcode 61: Rotate list

July 10, 2018

Introduction


It is a medium level algorithm called Rotate list. I plan to spend 10 minutes to go over the algorithm in next 24 hours.


Leetcode: Meeting room II - sweep line algorithm

July 10, 2018

Introduction


It is the algorithm called meeting room II. I like to try to use sweep line algorithm to solve the algorithm this time. I will write down something here.


Leetcode 75: Sort colors

July 10, 2018

Introduction


It is the algorithm called sort colors. We can use non-comparison sort, counting sort should be a good solution since we only have three colors.


Leetcode 2: Add two numbers

July 10, 2018

Introduction


It is the algorithm related to linked list. I like to learn how to write a recursive solution, since I like to write a short solution.

Here is the code I read from one of blogs, I like to try it later.

Recursive and iterative solutions


I like to write the code to handle a few test cases in the following order:

1. One of lists is empty;
2. Add one node list together, no carry;
3. Make it work if there is carry, then I need to call the recursive function twice instead of once.

4. Think about how to extend the linked list to more than one node. Add recursive call function.

Here is C# code I wrote using recursive function.

I also spent 10 minutes to review iterative solution written in 2015, and I reviewed the code.

Version of code: 2015  iterative, link is here.
Version of code: 2018  iterative, link is here.

Actionable Items


One way to train myself to write a quick recursive solution is to write a prototype one first. Here is the one I wrote to show how to do it.

Based on prototype function, I just need to add the linked list with more nodes.

I did not think cleary last night since the prototype is more complicated than copy linked list with a random pointer algorithm. Since the prototype already involves one recursive function call.

Monday, July 9, 2018

Enjoy tennis sport

July 9, 2018

Introduction


I just could not believe that I had such great time to play tennis and then I like to spend extra 20 minutes to study a topic to improve my tennis sports.

Here is the post on quora.com I like to study.


Being professional



I also came cross the post how to be a professional tennis player. The talk about being professional is such a great one. I like to copy the talk here.

I like to find some good topics related to summer tennis practice.

Racket sports serve up health benefits.

The Surprising Benefits of Playing Tennis – Tennis Quick Tips Podcast 46

10 hard level Leetcode algorithms

July 9, 2018

Introduction


It is time to say good bye to the weekend. This morning around 10:00 AM I wrote down 10 leetcode hard level algorithms on the paper first, and then I started to work on those hard level algorithms.

What I like to do is to build a good habit to work on hard level algorithms. I have to plan to work on those 10 hard level algorithms in the weekdays as well.

The algorithms are Leetcode 483, 488, 493, 499, 502, 514, 517, 527, 546 and 522.


Alexa.com report

July 9, 2018

Introduction


It is so interesting to read report on alexa.com about my coding blog. Here is the report. Here is the comparison with another popular coding blog with a million view already.

Will continue.

Sunday, July 8, 2018

Alexa - check list for writing

July 8, 2018

Introduction


It is Sunday evening 11:57 PM. I did 10 minutes research and came cross this Alexa.com article. It is called check list for writing.

I like to spend 20 minutes to read the article and write down some notes here.


Leetcode 488: Zuma game

July 8, 2018

Introduction

It is a hard level algorithm called Zuma game. I like to spend 30 minutes to work on it today. Now it is 6:43 PM. I like to spend next 10 - 15 minutes to read the discuss about the algorithm.


Leetcode 483: Smallest good base

July 8, 2018

Introduction


It is the hard level algorithm called smallest good base. I spent 30 minutes to think about problems and last 10 minutes to read discuss. I started from 5:09 PM.


Leetcode 126: word ladder II

July 8, 2018

Introduction


It is the hard level algorithm called word ladder II. I wrote a few blogs in 2016, and I like to review my past practice, and also learn something new.

One of simplified algorithm is only to return one of the shortest transformation sequences.

Have a plan


I like to submit my code using Leetcode online judge this time. I did not submit any code back in 2016, even though I spent so many hours.

I like to check in the code I wrote in 2016 and put into github. I also like to read Leetcode discuss and find out ideas to write simple code this time. Here is C# code link.

Leetcode 129: Sum Root to leaf number

July 8, 2018

Introduction


It is the medium level algorithm called sum root to leaf number. My idea to solve the problem is to pass in prefix sum and use recursive solution. My mistake in my first attempt on sample test case doubles the value from 25 to 50.

Here is my C# code.

Leetcode 295: Find median from data stream

July 8, 2018

Introduction

It is hard level algorithm. I like to review the algorithm using Leetcode online discussion panel.


Leetcode 480: Sliding window median

July 8, 2018

Introduction

It is a hard level algorithm called Sliding window median. I like to work on the algorithm. The optimal time complexity should be O(N), N is the size of the array. How to manipulate the sliding window.

Leetcode 322: Coin change

July 8, 2018

Introduction


The algorithm is medium level. I also wrote an answer on code review more than one year ago. But I have not submitted any answer through online judge.

I am planning to work on the solution and also read some discussion as well.


Backpack problem

July 8, 2018

Introduction

It is time for me to think about the algorithm related to backpack problem. 

m个栈里面有不同面额的硬币,最多pop n次,peek()可以查看任一位置的值,而不仅是最顶的。那么可以取出最多的总值是多少?一开始懵逼了,不知道怎么下手。面试官给我降低难度,只有一个栈的情况,进一步,只有两个栈怎么办? 逐渐觉悟到用递归搜索去解决。按着这个思路代码写出来了。回家复盘的时候,经友人提醒,是多个分组的背包问题


Leetcode 64: Minimum path sum

July 8, 2018

Introduction


It is the medium level algorithm called minimum path sum. I have not submitted any code yet. I like to work on the algorithm in short future. Here is the blog I like to study quickly.


longest subarray with zero sum

July 8, 2018

Introduction


It is Sunday morning. I like to read one of post about onsite algorithms, and work on one algorithm called longest subarray with zero sum.

Ideas 


Two pointers cannot solve the problem. It can be preprocessed all prefix sum from left to right, and then use O(N) time to iterate each element and look up prefix sum with the same value.

What is the possible extended question?


Reference:
1. Onsite algorithms - gist is here.


Saturday, July 7, 2018

Leetcode: Number of islands II

July 7, 2018

Introduction


It is time for me to write code for the algorithm called number of island II. I have warmed up three times on the algorithms, and I like to write one using union-find algorithm.

I tried to give the algorithm number of islands II in my 10:00 PM mock interview. So I had chance to learn more about the algorithm together with the peer.


Blog to study


Here is the blog I like to read. I also will put some notes in Chinese to a gist first.

How to learn to code (quickly and easily!)

July 7, 2018

Introduction


It is very good 11 minutes video related to learn to code.


Languages 


Usually the programmer learns how to write code using a new language by himself/ herself. It is called self-taught.


Why I don't read news

July 7, 2018

Introduction


It is a good research topic related to news value. I like the topic and like to learn something from the talk.

Here is the video's link.

Thing to be considered


What is noise and signal, and try to filter out the information.

10 Year in the life of a software engineer

July 7, 2018

Introduction


I found that it is very good entertainment to see a person can have such freedom to choose to work, travel and have a person life as well. Very good video and very good time to enjoy 10 minutes video.

The video link is here.


How I taught myself to code again (and got a job at Google)

July 7, 2018

Introduction


It is very good topic about teaching and learning to code again. I like the topic. It is 10 minutes video to watch. Here is the link.

Very good thinking process


It is such nice sharing in the forest. I like the sharing.

Computer science fundamental is very important.

Top 3 programming languages in 2018

July 7, 2018

Introduction


I like to spend 20 minutes on this video. It is talk about languages used, top 3 languages can be looked up through the website.


Mock Google interview (for software engineer job) - coding & algorithms tips

July 7, 2018

Introduction


It is 20 minutes video talk and I like to write down some notes. And I also like to study other videos provided by the engineer - Patrick Shyu.

Taking notes from the talk


3:00  Good consideration pros and cons of time and space. Remember show the impact.
Validate a lot of work, craft the story, as soon as some one asks you. Check the interviewer's reaction.

Do not make it too long. Keep it quick. Just 45 minutes. First 15 minutes talking about experience. Next 30 minutes about white board about the algorithm.

5:27
Ask an algorithm on the white board:
Given a grid, find maximum grid. It is commonly asked called flood fill.

How you solve?

Data structure, algorithm and ...

7:12
Tree view, you will be evaluated to have ability to rise a senior engineer level.
You do not have foundation to be a senior level. Tree traversal, and complexity ...

8:20 PM depth first search, double first search (can be BFS), it can be iteratively solved.

Leave it open ended. Grid data structure, 2-D integer.

To a junior, give a start pointer.

10:12  How interesting people can get those neighbors. You have to have a lot of bound check. GetNeighbors, and ..., save your much more time.

Delegate the way to do checking. Hashmap or hashset, what is your hashset. Sometimes you can have a red flag.

12:00 recursive function - 10,000 iteration - how big the grid will be? Push cells to stack or queue.

13:55 Write small font. Bring my own pen.

Tradeoffs, space and time tradeoff


14:42 It should be done before you write the code.

 You need to be able to understand time and space tradeoffs.

Talk about iterative solution vs recursive. At front it is best. We are just coding, we do not know what it is end? Time complexity.

Each cell just once.
16:02 - It is not really you got the answer. Whether you are confident on the answer, how you can do it.

17:25 Experienced interviewer.

Worst time to give the answer of the question.

17:59 Tradeoff between space and time complexity. Evaluation of your code, did you know tradeoff? Did you consider creating data structure? How is your efficiency? How is your jerk? Enthusastic? Take feedback. Overall value skills.

18:03 Your coding good, object-oriented programming. Did you consider using your own data structure?

Friday, July 6, 2018

Code Jam's kickstart

July 6, 2018

Introduction


It is my research task to read Lalit Kundu's quora posts, I spent a few hours to read one by one. I came cross this video talk 30 minutes, and I like to watch the video. Here is the link.

Take some notes


5:00 - 11:00
Talk about solving a problem using a graph. Very good explanation.

11:00 - ?
There is a talk about topological sort algorithm given by Lalit Kundu.

15:13/ 31:55
Some caveats

Not every Kickstart problem will reduce to a known problem or algorithm!
Many problems require creativity and insights
It may help to think through the problem and your algorithm carefully before writing any code

19:57 PM thought process?
So other people's mileage may vary here, do not know what to do right away. Just apply a small individual case and spot some pattern.

Lalit: make it a general form -

20:00/ 31:55 - you can summarize the problem in one statement. Explore certain paths, dynamic programming, greedy algorithm. Good strategy is do not code until you have ideas how to solve it.

I do not code it until I finalize and prove the algorithm.

21:30 It can save you a lot of time to have the correct idea before you write the code.


Quora reading time

July 6, 2018

Introduction


It is time for me to find some good question and answer to read. Here is the one. In order to show support, I also wrote an answer for the question.

My answer


Here is my answer to the question "How can I overcome the difficulties in implementing Data Structures?



Thursday, July 5, 2018

Leetcode 862. Shortest Subarray with Sum at Least K

July 5, 2018

Introduction


It is hard level algorithm. It can be solved using deque, sliding window and O(N) time complexity, N is the array length.


Wimbledon update

July 5, 2018

Introduction


It is the summer time. And it is so important for me to spend time to watch some Wimbledon sports every day.

Day 3 video is here.

Wimbledon grand slam

July 5, 2018

Introduction


It is the summer time and also it is time for me to play sports after the work. I like to spend 20 minutes to watch Wimbledon as well. I like to get more educated on the tournament.




How to decide if the interviewee can go to next round?

July 5, 2018

Introduction


I set up 4 weekdays 10:00 PM as an mock interviewer. I try to get connect to the community and help others to train their algorithm and data structure. I need to work on a few things after I replay and listen to my voice through the conversation. One thing I have to learn is to let more people to go to next round since I use one hard level algorithm to test interviewee, it is hard for a person to solve it in less than 30 minutes first time.

I find so much joy to talk to people and help me to recover from the daily full time work stress last few days. It is so much fun to talk about intern, coding, algorithm, and some tips related to ascending stack technique today.

I will make a check list how to evaluate a peer and decide if I should let him/ her go to next round. I will write down some notes. It is a good study topic for 10 to 20 minutes.

A check list





My second coach

July 5, 2018

Introduction 


I like to write a blog for my second coach this past June, 2018. I was too busy to write a blog about his help and tremendous generous sharing through three mock interviews with me.

Here is the github page I created to document my three mock interviews with my second coach.

863. All Nodes Distance K in Binary Tree

July 5, 2018 I spent 20 minutes to think about the algorithm first, and then plan to read one of discussion article.

Sliding window minimum

July 5, 2018

Introduction


I learn how to give out the mock interview with nice approach. I learned from one of peers giving me feedback, starting from an easy level algorithm and then extending to the hard level algorithm. Let the interviewee warm up on easy level algorithm, and also demonstrate how good he/ she thinks and writes code first. And then it is hard level algorithm if there is need.

I continuously give the same algorithm to people last 5 interviews. I keep coming cross Microsoft programmer or intern from big four companies in the city of Seattle. And also the programmers in the Sillicon Valley. It is easy for me to form a small group for more discussion once a while. I only found one more person to join the small group discussion last one week.

Keep learning


I try to observe myself how I can understand the algorithm by having discussion with different peers. I wrote some hints today. I just keep practice, and work on one thing a time.

Sliding window is most popular algorithm asked in the algorithm interview. It is easy to relate to an array, and also easy to hop on and get some good training on thinking process.

Every time I wrote down some hints.

July 4 10:00 PM - 11:00 PM


July 3, 10:00 PM - 10:50 PM

June 28, 10:00 PM - 10:50 PM

Leetcode spase matrix multilplication group discussion

July 5, 2018

It is our discussion within a group of three people. The time was from 8:30 PM to 10:00 this past Tuesday.

I like to continue to think about this algorithm when I have time. Here is the transcript.


Group discussion

July 5, 2018

Introduction


It is very pleasant to see myself to involve a small group and then we  had good discussion about algorithm together this Tuesday from 8:30 PM to 10:00 PM. This past Tuesday 8:30 PM, we had three people taking turn to discuss one algorithm a time. I had chance to give out an algorithm Jigsaw algorithm and lead the discussion with other two.

Discussion 


I always think about one algorithm last two weeks. I need more challenging thing to do. Last long weekend I worked on seven hard level algorithms. But I still thought about same algorithm again and again. My brain is working this way. So amazing! I better do not waste my energy on the same algorithm. 

Here is the discussion transcript. 

I also like to continue to search and find some interesting to read related to how to design API. 


Actionable Item


It is time for me to do some study about how a person can develop strong interest on algorithm problem solving. 

I used to read mathematics for computer science book. I found that it is very interesting to read. 

How to motivate myself to write 100 lines of code everyday?

July 5, 2018

Introduction


I spent over one hour to write a hard level algorithm called Maximum gap today. I noticed that it is too slow compared to those algorithms I wrote more than 20 times, for example, I can write Sudoku Solver in less than 30 minutes, and I even can remember how many variables I need and how many statements I need to write down, less than 40 lines of code.

I think that I need to train myself to write 100 lines of code against Leetcode online judge every day. There are 128 lines of code for the algorithm Maximum gap including empty line.

If I can write 100 lines of code, and also use Leetcode online judge to train myself to think more carefully about edge cases, I also learn to implement the idea. As a programmer, the most important part is to be able to write perfectly working code in limited time.

Leetcode algorithms


I only submitted Leetcode through online judge for 97 algorithms since 2015. I cannot compete with people with more than 500 algorithm submissions.

Actionable Items


I always think about how to solve jigsaw algorithm recently. One thing I like to do is to ask myself before I write code, can I make my idea more advanced in terms of time complexity, can I scale the problem to millions of row, do I have time out issue or run-out-of-space concern?


Leetcode 864: Random Pick with Blacklist

July 5, 2018

Introduction


It is very good idea to read article related to Leetcode algorithm. The algorithm Leetcode 864 is a hard level algorithm, I had chance to read one of articles.

I will write down something here.

Wednesday, July 4, 2018

Case study: How hard you can train yourself as a software programmer?

July 4, 2018

Introduction


I did study leaderboard of week of code 38 in Canada after the contest last week. I came cross this profile and also his youtube.com channel.

I like to learn from his work. He plays more contest than I do, he also writes a very good blog here.


Tuesday, July 3, 2018

Grigor Dimitrov speaks of his tough first-round loss - Wimbledon 2018

July 3, 2018

Introduction


It is so interesting to watch the interview and I like to learn how to handle the failure. Dimitrov is my favorite tennis sport player.

Good sharing


Stay positive.

4:00/ 11:08 Do not look for excuses.
5:00/ 11:08 Expectation is too high. I could not deal with pressure now. The big pressure is coming from myself.

6:38/ 11:08 Let it sink little bit. I need to calm myself a little bit. Think about rational.

7:57/ 11:08 He is more determined. It is hard for me to accept the losing. It is tough to swallow.

The pigeonhole principle

July 3, 2018

Introduction


It is very popular principle called the pigeonhole principle based on the simple math. I like to study more based on the lecture note written for the maximum gap problem.

The lecture note link is here. And it is also saved on my github.

I like to read the notes carefully and do some research on this pigeonhole principle.


Leetcode 296: Best meeting point

Leetcode 174: dungeon game

Leetcode 164: Maximum gap (Series 1 of 5)

July 3, 2018

Introduction


It is a hard level algorithm called Leetcode 164: Maximum gap. The optimal solution is to use linear time complexity, so the array cannot be sorted using comparison sort. However, if the bucket sort can be applied, and then the array can be sorted using linear time. How do we know the bucket size?

I spent over 20 minutes today to think about the solution. I did think about maximum and minimum value of the array, but what is minimum gap for the array? Can we use the minimum gap to define a bucket? I need those two hints to help me come out the solution.

My practice in 2015


Here are some facts I like to review related to the algorithm.

1. I wrote more than 2 blogs about the algorithm: Leetcode 164: Maximum gap in 2015. Here are the links.
2. I did not submit the code through Leetcode online judge.
I should have submitted the solution.
3. The C# code I wrote could not be found. The gist's link is broken.
4. I spent more than four hours to work on the algorithm in 2015.

My practice in 2018


I plan to write C# code again. It is so exciting to write a hard level algorithm, and understand how important it is to lower down time complexity.

Here is C# code passing online judge.


Monday, July 2, 2018

Job hopping vs Seeking professional development

July 2, 2018

Introduction


It is the long weekend Monday. I stayed at home, and worked on one hard level algorithm, two mock interviews. I had chance to talk to a lead in another country called Spain, and then also I had chat over 15 minutes with a young professional in San Francisco.

The young professional in San Francisco advised me to spend 80% of spare time to work on problem solving skills, as a software programmer, work on algorithm and data structure. You should try to find a good company to allow you to learn advanced frontend technology, but you will be out if your problem solving skills are not so good.

My research topic for the next one or two hours is to understand the article called "Are you job hopping or seeking professional development?". The link is here.

30 minutes study


I like to write down some notes from the article, and I like to understand the ideas as well.

Self-aware  


Statement:
The most effective leaders take the time to develop a practice that enhances self-awareness.

A job-hopping history raises curiosity about whether you know who you are, what you are good at, and where you can make a meaningful contribution.

Smart companies know that self-aware employee are crucial.
  They are better at building relationships with others,
  They are better at managing themselves and creating positive impacts on their environments.
  They often know how to adjust communication to optimize effectiveness.

Experience and curiosity

The trick is to find a balance between curiosity and commitment.

Take the time to think about what you do well and what you enjoy doing most.

Being engaged and productive at work sometimes is the best way for new opportunities to find you.

If you are self-aware, you will notice when these opportunities appear.

My understanding


I do not have psychology degree. This is the first time I read the article and I like to think carefully on those arguments.

The pros and cons of job hopping

July 2, 2018

Introduction


It is a good article to spend 10 minutes to read. The title is called The pros and cons of job hopping.

Pros


Here are the list of pros.

Diverse background.
Access to more information and resources.
Exposure to different businesses and people.
You’ll have a large, resourceful network.
A chance to find the right fit. 
Exposure to different jobs.
An opportunity to show off some of your best attributes.
More money

Cons


Employers will be hesitant to invest in you.
Your job may be less secure
Lack of satisfaction
You may damage relationships
They may question your judgement
They'll fear you'll leave at the first sign of trouble




Here is the truth about how job hopping affects your career

July 2, 2018

Introduction


It is very well written article to read called Here's the truth about how job-hopping affects your career.

10 minutes study


I like to study 10 minutes and then write down a few words, I can look into later.


Career advisor study

July 2, 2018

Introduction


It is time for me to do some study related to career adviser. I came cross this medium article by Larry Cornett.

Eight years on the job celebration

July 2, 2018


Introduction


It is the first time in my career I am able to stay in the same job more than eight years. I just had a great celebration to have a trip to Seattle in June 2018. Also I like to take some short time like 30 minutes or so to study how to manage my career.

How do I spend last eight years? What have I learned as a software programmer?

30 minutes study


Here is one article I plan to spend 10 minutes to read first.

Here is something I like to read first, and then search some keywords in Google.com.

One U.S. boutique firm specializing in IT evaluates candidates on two axes: stability and “performance and capability indicators.” Candidates have to score well on both to be selected for interviews. A consultant at another firm told me that a short stint—less than three years or so—probably wouldn’t be sufficient to produce any meaningful contribution to a firm and thus wouldn’t do much to demonstrate a candidate’s value. Search consultants also tend to interpret frequent moves as a sign of bad decision making, whereas long organizational tenure is rarely seen as reaching a plateau.

A short stint - less than three years or so. 

Search job hopping and then here is another article. 

 “When I see that someone has hopped jobs and gotten increasingly better titles with each new job, it’s a gigantic red flag for me as a hiring manager,” says Souza. “It shows me that they weren’t doing good enough work to get promoted within a single organization, so they had to climb the corporate ladder by continually going somewhere where they have no history.”

Here is the article with a video. 

Leetcode 265: Paint house II

July 2, 2018

Introduction


It is a hard level algorithm called Paint house II. And I like to use this blog to read problem statement.

30 minutes study


Now it is 11:09 AM, I like to spend 30 minutes on the algorithm.

One of ideas is to solve the problem using dynamic programming. At each position of houses, index, it is to get minimum cost to paint each color with color Id.

I notice that greedy algorithm will not work. If every house index the minimum cost is saved without color Id, next time the minimum can not be generated by previous minimum cost. Since we have to compare all colors, the previous one's color id is unknown.

To solve the problem, we have to keep the minimum cost for each index with each color. That is a lot of calculation. Each color ...

I need to get hints to think about simplifying the problem, only keep last two minimum values. Therefore, all colors can be considered for each index position. This is a major hint I need in my thinking process.


Solution study


Here is Chinese version of discussion from the blog:

题解:
是Paint House I的generalized版本。这回颜色不是RGB三种,而是扩展到了K种。正好可以试试在Paint House I中没用上的想法。思路还是使用DP, 这回我们需要维护一个刷当前房子之前所有房子最小的花费min1,以及倒数第二小的花费min2。然后我们再遍历当前房子i所有color的花费,假如这个颜色与之前i-1号房子的颜色相同,我们选择min2,否则选择min1。比较完所有颜色以后我们记录下来当前的curMin1,curMin2以及current color, 更新min1,min2和lastColor,就可以继续计算下一个房子了。
Time Complexity - O(n), Space Complexity - O(1)

Leetcode 262: Trips and users

July 2, 2018

Introduction


It is a hard level algorithm called Trips and Users. Now it is 10:56 AM, I like to spend next 20 minutes to read the problem statement and think about ideas to solve the problem. And then I will spend 10 minutes to find solutions, have a quick study using 10 minutes.

It is my idea to speed up learning process of hard level algorithm. I like to train myself think about hard level algorithms at least 3 of them in a day. One for morning, one for afternoon, one for evening.