Wednesday, October 24, 2018

1000 submissions

Oct. 24, 2018

Introduction


It is time for me to work on one easy level algorithm, so I can have 1000 submissions. I am so excited to work on my 1000th submission in short future.


What it takes


It takes a lot of hard work, time and also wisdom to reach 1000 submissions. It is much hard to compare to get a gold medal on Hackerrank.com, and also any course work I had in mathematics major in Florida Atlantic University, all courses work together in my bachelor degree and master degree, include Ph.D. study.

I also have to learn so many things in order to make a successful submission sometimes.

The Leetcode community is different from Hackerrank, some of us are ready to share just after the contest. The discuss ratio compared to all submissions is not that high, for example, over 300,000 submissions in 39 Sudoku solver only less than 400 discuss.

This is also time for me to learn how to write code; I am so glad to read ideas and then write code for various ideas.

I learn from my own experience, last month I worked on easy level algorithm binary watch, I felt nervous as I did in the phone screen. But once I started to read various ideas, I felt so relax and enjoyable to work on those ideas. I learn to deal with my own emotions, I have to push myself hard to think independently more often, before I read the discuss. I will have to get used to figure out things by myself. Hopefully next 1000 submissions I can train myself to overcome this nervousness issue.

Those 1000 submissions also help me to have the chance to be get two phone screens and one onsite interview this year. Without those encouragements from Amazon and Facebook, a few of local companies, I will not be smart enough to work on so many submissions. I also had thanks to my ex-coach, I have to stay humble and work on those easy level algorithms first, without those 200 easy level algorithms practice, I will not have chance to reach 1000 submission mark.

My personality is kind of over confident sometimes, and sometimes low on confidence. I have to learn how to make good judgement where I am in terms of confidence level.

I have to stay humble, start from easy level, and work on the foundation skills. I also overcome my shyness, first time in those easy level practice, I decided to share my practice on Leetcode discuss. I started from August 11, now it is two months experience with over 100 sharing 20 reputations.

Also through those easy level algorithm practice, I started again to play Leetcode weekly contest, I have played over 8 contest last two months. It is so good journey for last two months. I read one blog I wrote in August 31, at that time, I solved 177 algorithm with 679 submission. Based on the facts written in the blog two month ago, I can easily find out that I solved 88 algorithms with 321 submissions from August 31 to Oct. 26, 2018.


Over 9000 submissions on Leetcode.com

Oct. 24, 2018

Introduction


It is time for me to write something called over 9000 submissions. I chose to follow my ex-coach's advice, and then I work on easy level algorithms first. I chose to work on two easy level back-tracking algorithms, I found one most elegant solution. And then I studied the player, over 9000 submissions.

9000 submissions


I read the number, and then I talked to myself. I am gambling to try my luck to compete with those hard working players. With the experience of 900 submissions, how can I compete with people with over 9000 submissions.

Can I work on 500 more submission this year?

A player can work on 9840 submissions on Leetcode.com, and also he managed to complete 760/921 algorithm, his ranking on contest is 1113/72819. Leetcode ranking is 366. He also completed 86 mock interviews, with overall percentile 72%.

I like to compare to my data. I solved 265 algorithm, contest ranking is after 13,000. The overall ranking is after 20,000.

Three ideas


I need to find out ways to have more submissions on Leetcode.com. One thing I can think about is to work on those 200 easy level algorithms again, but this time I will submit different ideas for those algorithms. So maybe I can make more than 600 submission, each algorithm 3 submissions more.

I also can try to work on medium level algorithm or hard level algorithms now. There is nothing I can be afraid of. The idea is to shorten the time to work on medium level or hard level algorithm to 20 to 30 minutes, and go back to work on easy level algorithms and learn better on those algorithms.

Easy level algorithm is really a good playground for me to learn. There are more players to share the experience, more ideas for me to learn and practice. And also I can really build up confidence to write code every day, learn how to overcome the stress or intimidation for coming out the idea to solve the problem by myself.

Follow up 

Oct. 29, 2018

Another idea is to find one good sharing post for hard or medium level algorithms, the thing I like to focus on is to imitate the role model and write my C# solution. This may be a good idea for me to try, at least I can find 20 or 30 players with good writing skills and patience.

Nov. 5, 2018

I also like to find out how I can find time and get some tips to work on more algorithms. One idea is to study kid's playground, how kids learn to play in the playground. Since Leetcode actually can be treated as a playground for so many players.

I believe that medium level or hard algorithms are good playground for me. I do not need to stick on one hard level algorithm. As long as I keep going, I will build up some skills through those practice.

One idea is to go over same category algorithms together, work on together. One idea is to work on the algorithm 8 hours a time, and see how I can improve my performance, what problems I have in those 8 hours.

Last time I did work on 8 hours for linked list algorithms. I found out that I really felt so exhausted after 4 hours. I need to take breaks. Another thing I found out is that I did not push myself hard to think about constraint, and then play with the linked list and then come out by myself.

The biggest problem is that I do not want to push myself to think independently.




Tuesday, October 23, 2018

Most efficient way to train myself

Oct. 23, 2018

Introduction


It was so surprising that I found one algorithm called binary watch to work on. I found out that it was most rewarding experience to work on more than five practice in a day. I really enjoyed the learning. I also think that most efficient way to train myself is to write as many ideas as possible. There are more than 200 discuss, I should write as many ideas based on those sharing.

Algorithm and data structure


I think that most efficient way is to write code every day. Specially for an algorithm like binary watch, it is such great tool for me to train myself.

I have chance to work on bit manipulation, recursive function, and learn a few things through C# coding. 

Follow up 

Oct. 29, 2018

Avoid long hours to work on one algorithm


I think that it is much better to work on easy level algorithm. If there is something hard to solve, I should work on easy ones first. Through those easy ones, I may find good ideas through Leetcode discuss. I also may learn different ways to solve the problem.

Make Leetcode weekly contest part of training. Take it easy for the weekly contest, so I will be more happy to take part in every contest. I also can think about those 4 algorithms in 90 minutes should be a good sprint. I can use this format to train myself as well.

Set a good goal


One goal is to be able to pass any high standard algorithm and data structure interview, no matter it is a phone screen or onsite. But I also can train myself to pay attention to my own habits, the way I solve problems, the way I choose to communicate. I should find something to work on. For example, I started two months ago to write for Leetcode discuss.

Another thing is to prepare early. How to prepare early? I need to gather some information first, I need to gather some data how others train themselves, specially those top performers.

I like to build up a good habit to be an educator in other areas as well. 

Leetcode 401. Binary watch

Oct. 23, 2018

Introduction


It is an easy level algorithm I chose to work on. It is marked as backtracking in my 34 easy level algorithms to work on, I documented the detail in my blog. What I was surprised to learn that the algorithm has 240 discuss, and I did study over five of them, I wrote five solutions.

My practice


There are so many good ideas to work on. I like to write more solutions later on. I was so surprised there are so many good players and I like to choose them to be my role models.

Here is my folder to contain all my practice.

Here is the discuss link I wrote for bit manipulation and recursive solution. This is most elegant solution I wrote so far.

Still more than 100 discuss to learn from


I am kind of surprise that I can learn so many ideas from the discuss. It is such a good algorithm, I like to write if I have 10 or 20 minutes.

I like to share those five practice first on Leetcode.com.


Sunday, October 21, 2018

IELTS & TOEFL Writing: 5 Common Mistakes

Oct. 21, 2018

Introduction


It is time for me to learn something better in my life. One way is to find those coaching videos. It does not matter, as long as those coaching are really making good sense, related to most important and basic skills to living in Canada.

I choose to work on writing skill and learn about common mistakes.

One video a time


Here is the video I chose to watch today.


How to make a good living in Canada?

Oct. 21, 2018

Introduction


It is the first time I choose to spend time to drive to nearby cities near Vancouver in October every weekend, instead of playing tennis, I like to explore nearby cities. I also like to do some research about British Columbia and then I have more knowledge about Canada. I did some research from 2010 to 2018 and stay away from real estate market in Canada. I like to go back to learn some basics again.

A good living


It is important for me to work hard and save money. I also need to learn how to make a good living to invest early using my limited saving. I spent a few trips to Surry, Langley, Abbotsford from 2010 to 2014 to visit those new condos in Surrey and Abbotsford.






IELTS reading

Oct. 21, 2018

Introduction


How to improve my performance in terms of algorithm and data structure training. I play weekly contest and work on easy level algorithms, and last Saturday I failed one easy level algorithm problem understanding. It is the first time I like to try a few weeks to work on IELTS reading skills, one of ideas is to watch a lot of videos from youtube.com first.

One video a time


Here is the video I choose to watch today.

My argument is based on the fact that a good programmer should have very high ability to read and write in English. One way to improve is to keep myself open to those coaching from good educators. I like to learn by myself by watching a lot of videos from youtube.com.

Problem statement understanding - reading challenge

Oct. 21, 2018

Introduction


It is the algorithm I made a few mistakes in understanding in the weekly contest called 926 Flip string to montone increasing.

A few misunderstanings


There are a few misunderstandings, I highlight those place I missed in my 10 minutes thinking in the contest.

A string of '0's and '1's is monotone increasing if it consists of some number of '0's (possibly 0), followed by some number of '1's (also possibly 0.)
We are given a string S of '0's and '1's, and we may flip any '0' to a '1' or a '1' to a '0'.
Return the minimum number of flips to make S monotone increasing.

More detail about understanding:
1. all 0's is fine as an answer
2. all 1's is fine as an answer
3. The string is in pattern of 0's followed by 1's, but my thinking is more complicated, 0's followed by 1's and then continue to have 0's, followed by 1's. I just made the problem very hard and may not have an answer. 

Tsawwassen

Oct. 21, 2018

Introduction


It is a normal Saturday morning, but I got up at 6:30 am to drive to Tsawwassen to help a friend to cross border to land as a permanent resident of Canada.

I spent whole day in the city of Tsawwassen after the visit of border. Two hours in the mill, and one hour in the regional park centennial beach boundary bay.



Saturday, October 20, 2018

Leetcode 926. Flip String to Monotone Increasing

Oct. 20, 2018

Introduction


It is a medium level algorithm. I thought about the solution in weekly contest 107 over 10 minutes, but I could not come out the solution in the limited time. So this is my perfect time to learn the algorithm.

Good idea 


Here is one of sharing written in Chinese.

这道题是一维数组加状态机的动态规划。
我们假定DP J,是到J位符合递增的序列. 那么根据J位是0或1,我们会有2个状态。
如果J位是0,我们只能从J-1位是0得过来。同时如果这个是字符串的第J个和最后的状态要求不同,需要翻成对应字符而需要+1。
如果J位是1,我们可以从J-1位是0 或者J-1位是1得过来。同时如果这个是字符串的第J个和最后的状态要求不同,需要翻成对应字符而需要+1。

作者:西部小笼包
链接:https://www.jianshu.com/p/c8dbaaf87644
來源:简书
简书著作权归作者所有,任何形式的转载都请联系作者获得授权并注明出处。





Leetcode 927. Three equal parts

Oct. 20, 2018

Introduction


It is a hard level algorithm. I tried to write the solution in the contest but I could not manage to pass online judge since I had several issues.

My solution


I wrote a solution and shared on leetcode discuss. Here is the link.


My journey


I spent 50 minutes to work on the algorithm in the last week contest. I made the first submission until there is 10 minutes left. And then I submitted second time.

First submission is here, line 35 index out of range runtime error.
int index2 = map[numberLength];

Second submission is here, I gave the wrong answer. I need to review the definition of return indexes. Line 44 statement needs to be changed. 


Actionable items


Definitely I should work more carefully on some test cases, so I can verify my code is working for those test cases.

I also need to figure out how to simplify the code before I make any submission. There is a 5 minutes penalty for each failed submission.

Leetcode weekly contest 107

Oct. 20, 2018

Introduction


It is the weekly contest again. I learned a few things this time. It is very important to learn who shared the solution just after the discuss, so I can learn those who performs much better than me.

One role model 


Here is one role model I like to learn from, since the player solved all 4 algorithms and also wrote a blog for each algorithm in Chinese with solutions. Since I almost finish all easy level algorithms on leetcode.com, I should find ways to learn various advanced players, no matter who they are. I like to learn how to advance my ranking in the contest first.


Algorithms


925. Long pressed name code written in contest
925. Long pressed name Elegant solution learned after the contest
926. Flip string to monotone increasing
927. Three equal parts Take me more than one hour


Actionable Items


I need to learn to stay humble. Sometimes I am stumble on easy level algorithm in the contest, and also I could not complete a hard level in the contest. My problem is that I have to rely on Leetcode online judge to find bugs first. 

It is time for me to show my result using an image. I will remember the mistakes I made on second easy level algorithm, and the effort I put in the third hard level algorithm. 






Thursday, October 18, 2018

My stock and IRA stock account recovery

Oct. 18, 2018

Introduction


It is time for me to get organized. Recently I reviewed through gmail and then recovered the accounts from Ameritrade I had last 10 years. I did sell all the stock and IRA stock back in 2008, and then I moved on. The idea is to focus on one thing only, at that time, it is the immigration.

After 10 years, I learn that I may make the mistake and I should have allowed those stocks to stay in my stock account instead.

What if 


It is so hard to get in Faceook or Amazon to work as a software programmer. But at the very beginning with the phone screen with those two companies, I should purchase 100 shares of stock. I had a phone screen with Facebook January 2015, and I had first phone screen with Amazon back in 2007.

2007 Amazon stock price:   $80/ share -> 8000 dollar investment -> 2018, 100 * 1800 -> $180, 000
2015 Facebook stock price: $78/ share -> 7800 dollar investment -> 2018, 150 * 100 -> $15,000

I can quickly learn from stock's value of those companies, and then I also benefit from the investment more than 100% easily.

Actionable Items

April 12, 2019

I like to write a blog about my first Amazon phone screen interviews and my impression of Amazon as a company and culture.

IELTS writing task 2: The 3 sentence introduction by Jay!

Oct. 18, 2018

Introduction


It is a good idea to learn how to write good introduction from IELTS writing teaching. Here is the video link.

3 step introduction


1. Neutral background sentence
2. Rewrite the question
3. This essay will


IELTS writing

Oct. 18, 2018

Introduction


It is very good idea to save money and time to learn writing just by going through IELTS writing videos. I like to boost my score to 8 if I need to take IELTS test. Here is the video.

I also like to improve my reading skills when I work on algorithm and data structure problem solving. I experienced some difficulty on a few algorithms on problem statement, so I just like to set a target to work on - improving writing skills.

Writing tips


A wide variety of sentence structures.
Grammar - range should not be limited

Accuracy = 9
Range = 4

Task = 8
Structure = 8
Vocabulary = 8
Grammar = 4

six sentence types -
sentence types
1. simple sentence/ compound sentence





Wednesday, October 17, 2018

Kelowna city study

Oct. 17, 2018

Introduction

It is time for me to study a city called Kelowna.


Find a home to purchase in British Columbia

Oct. 17, 2018


Introduction


It is my research to find a home to purchase in British Columbia. I started to study top 10 cities in British Columbia, and then I had so much fun to learn so many cities.


How to become a good programmer?

Oct. 17, 2018

Introduction


It takes so many years for me to finally know how to train myself to be a top programmer. It takes years.

I like to write a blog related to learning experience I had last three months.

Work on easy things first


It is important for me to learn that I should work on as many easy level algorithms as possible. Through those practice, I can build good habits to solve problems every day, write code every day. And also I like to learn various ideas to solve the problem.

I believe that best learner is to learn from the easy things. There are so many things to work on, and it is so easy to advance the algorithm to the hard level one.


Play leetcode weekly contest


I have to push myself hard, and accepty myself for poor results. I have to take part in every contest and also very active to join the discuss after the contest.

I find that it is the way for me to get better and also learn from very good players after the contest.

I am in the stage called hang in there, I just need to join the weekly contest and show the ranking after each contest, and learn quickly after each contest. I need to get more involved in the discuss, and learn from those sharing just after the contest.

Right now, I learn from my Leetcode weekly contest experience. I have some issues sometimes with easy level algorithms; And I also have issues to score hard level algorithms, since there are multiple test cases, I have problems to manage the code in less than one hour for one hard level algorithm.

I need to figure out ways to push myself hard in my daily practice. Now it is too relax compared to the weekly contest.

I believe that it is the way to become a good programmer.



Celebration of 960 submissions

Oct. 17, 2018

Introduction


It is time for me to learn how to be a nice player and say thanksgiving to my coach this June. I had chance to find my weakness, I need to work on easy level algorithms first.

After I solved 160 easy level algorithm, I had chance to celebrate 960 submssions on Leetcode.com.

Get smarter


It is easy to get smarter once I learn from my past 300 submissions. I solved 160 easy level algorithms last three months, I had over 300 submissions.

I started from January 2015. From 2015 to June 2018, I only has submissions on Leetcode.com less than 600.

I need to learn those players, every year with over thousand submissions. Without taking any course, any cost of tuition, one player can learn how to write good program through those Leetcode.com algorithms.

One thing I like to do is to take easy level algorithms first. And also I need to learn that it is important for me to build good  habit to write code everyday.

Submissions


I learn to read other people's profile by checking total submissions.

Here is mine.



Here is my role model with over 2800 submissions. The role model solved over 800 algorithms.

What is difference from mine, 260 solved algorithm, 900 submissions. There are  more than 540 algorithms, more than 1900 submissions. Each contest on Leetcode.com has 4 algorithms, so 540 algorithms can be used almost 150 weekly contest algorithms.

In other hand, every onsite interview from Faceook or Amazon, the interviewee will work on 4 algorithms. The extra practice is like a player having more than 100 onsite interviews experience from various software companies, all of those are very focusing on algorithm and data structure as well.



Say goodbye to easy level stack algorithm

Oct. 17, 2018

Introduction


It is very good learning experience to work on those easy level stack algorithms. I finally had time to work on those algorithms one by one. I still remembered that I was told to work on easy level algorithms this June, and I had a coach session with the coach related to next greater element algorithm.

Easy level algorithms


Here is the image to show all easy level algorithms I completed.


Easy level stack algorithm (solved 7/7, shared 7)

20. Valid parentheses
155. Min Stack 
225. Implement stack using queues
232. Implement queue using stacks
496. Next great element II
682. Baseball game
844. Backspace string compare

Celebration of 260 mark

Oct. 17, 2018

Introduction

It is time for me to celebrate 260 mark. I just finished 260 algorithms, since recently I solved another five easy level stack algorithms.

I have to stay humble, and also it is very important for me to put the algorithm practice in the highest priority.


682 Baseball game

Easy level stack algorithm (solved 7/7, shared 7)

20. Valid parentheses
155. Min Stack 
225. Implement stack using queues
232. Implement queue using stacks
496. Next great element II
682. Baseball game
844. Backspace string compare

496 Next greater element I

Easy level stack algorithm (solved 7/7, shared 7)

20. Valid parentheses
155. Min Stack 
225. Implement stack using queues
232. Implement queue using stacks
496. Next great element II
682. Baseball game
844. Backspace string compare

Mock interview experience III

Oct. 16, 2018

Introduction


I learn from my own mock interview experience. After the mock interview on Oct. 15, 2018, I got the complaint from the interviewee. So I decided to spend extra 30 minutes to help and have discussion with the interviewee.

I had chance to work with the interviewee this time, and then we had good discussion how to solve those algorithms.

How to explain the approach? 


Here are the hints I gave in the mock interview. The algorithm is called longest univalue path on Leetcode.com, easy level tree algorithm.



My advice


I also wrote down my advice after the mock interview as the interviewer.


Mock interview experience II

Oct. 16, 2018

Introduction


It is time for me to learn from my mock interview experience. I decided to make changes after the complaint from my last interview.

The algorithm


Here is the algorithm the interviewee wrote. I will write a similar solution and submit it on Leetcode.com.


Mock interview experience I

Oct. 15, 2018

Introduction


I like to write down my own learning experience as an interviewer on interviewing.io. Recently I interviewed one young graduate student, and I did not like to take extra time after the first 45 minutes. But I got some good advice from the anonymous interviewee.

Feedbacks


Here is my review as an interviewer.


Here is interviewee's feedback.


Actionable Items


I decide to take the advice and work with the interviewee, give hints and have some discussion how to think and analyze the algorithms if the interviewee does not come out the optimal solution.

225 Implement stack using queues

Easy level stack algorithm (solved 7/7, shared 7)

20. Valid parentheses
155. Min Stack 
225. Implement stack using queues
232. Implement queue using stacks
496. Next great element II
682. Baseball game
844. Backspace string compare

232. Implement queue using stacks

Easy level stack algorithm (solved 7/7, shared 7)

20. Valid parentheses
155. Min Stack 
225. Implement stack using queues
232. Implement queue using stacks
496. Next great element II
682. Baseball game
844. Backspace string compare

IELTS test

Oct. 17, 2018

Introduction


It is time for me to do some research on how to improve reading skills. I review the test result I did in 2008, I did three tests.

I like to work on my English reading skills, in order for me to improve my performance on Leetcode weekly contest, and also I like to solve more algorithms on Leetcode.com.

My IELTS test 


Here is my test result in 2008. I like to work on reading skills once I have 30 minutes.


Actionable Items


Work on those videos, IELTS reading skills/ writing skills as well. Here is one of videos.

34 easy level algortihms

Oct. 17, 2018

Introduction


It is time for me to write more code and also prepare for medium level algorithms on Leetcode.com. I have 34 algorithms to work on, each of them is easy level algorithm. 

34 algorithms


Here are the details:

2 back tracking, 784, 401
2 Binary search tree, 783, 530 
9 Bit Manipulation, 9 algorithms
2 Breadth first search, 2 algorithms
4 Depth first search,  897, 690, 733, 743
1 Graph, 743
3 Greedy, 860, 455, 874
2 Heap, 703, 743
8 Linked list, 876, 206, 237, 21, 83, 141, 160, 707
1 Two points, 141



Tuesday, October 16, 2018

The score will take care of itself - My Philosophy of Leadership

Oct. 16, 2018

Introduction


It is time for me to read some Chinese article. Here is the article. I like to learn something from Bill Walsh

Here is the notes from the article: 

The score will take care of itself

其实呢,写了这么多,我想和大家分享我当manager以来读到的最喜欢的一句话
是NFL橄榄球队49ers的传奇教练Bill Walsh的写的关于管理的一本书的书名
The score will take care of itself
什么意思呢?就是你只要好好训练,好好练习,专注你该专注的,那么比分会自己出现在那里的
同理,我看career,也觉得,管好我自己,不断提高自己,那么 
The money will take care of itself





Monday, October 15, 2018

Why Vancouver's real estate price goes up?

Oct. 15, 2018

Introduction


It is time for me to read some articles related to topic of real estate price. Here is the article.


Leetcode ranking and progress report

Oct. 15, 2018

Introduction


It is my idea to record the numbers from Leetcode.com every two weeks. I found out that last two weeks I only solved xx algorithm with 30 submissions.

My status


Here is my status today. Now it is 9:50 PM.




Based on the blog written two weeks ago, I can easily tell how many submissions I did and problems solved.

Comparison after two weeks


                     Ranking    Submission  Solved      Contest Global ranking  Contest Rating
Oct. 15         29200          533              256/917     13292/72190                      1673
Oct. 5           30987          507              249/909     12026/71276                      1692                             

I solved 7 algorithms, 33 submissions. My ranking advanced over 1700.


Leetcode weekly contest 106

Oct. 15, 2018

Introduction


It is the weekly contest and I was so busy with the first three algorithms. I could not solve the third one, and I did not have time to read the problem statement of the fourth one. There are over 400 people scoring full score, and there are over 1000 people to solve the first three algorithm.

My performance


I like to list all first three algorithms' discuss link in the following.

922. Sort Array By Parity II

921. Minimum Add to Make Parentheses Valid

923. 3Sum With Multiplicity  dynamic programming solution

923. 3Sum With Multiplicity


Comparison to top five



Here is my performance.



Third algorithm struggle 


I like to show how many submissions I had to work on in order to pass online judge. It took me one hour to pass online judge. I tried at least 20 minutes in the contest, and then after the contest, I tried another 40 minutes.



The algorithm is my favorite algorithm, and I came out the optimal idea in the contest. Since I worked on three sum so many times, I also asked the code review here.

My short term goal


I like to work on 100 medium level algorithms, so I can perform very well on the first three algorithms in the weekly contest. And then I will have chance to work on hard level algorithm with 10 or 20 minutes if possible.


Sunday, October 14, 2018

7 common mistakes in the coding interview (for software engineer)

Oct. 14, 2018

Introduction


It is time for me to learn something daily. One thing I find out valuable to do is to work on those coaching video. Today I went to Hackerthon, I found out that I may have some problem about team work. I felt that it was hard for me to push myself and then I may waste time by not pushing hard enough.

Here is 7 common mistakes in the coding interview.

7 mistakes


1. Get a referral
2.