Friday, November 9, 2018

Life is tough to work with 18 medium level tree algorithms

Nov. 9, 2018

Introduction


It is my plan to work on 18 medium level tree algorithms. I spent 30 minutes to think about two medium level algorithms, I had hard time to come out clean and elegant solutions for those two algorithms. Life is tough now to work with those medium level algorithms.


Nov. 21, 2018

It is such sweet feeling to solve the algorithm called 863. All nodes distance K in binary tree.

I like to highlight a few things to help me expedite the problem solving process.

1. Use Dictionary<TreeNode, HashSet<TreeNode> to represent the graph
2. Tree traversal algorithm is easy to write
3. Understand the graph - directed graph using Dictionary
4. Use queue to track k steps away nodes, using visted hashset to avoid loops.

Medium level tree algorithms (solved 19, total 39, shared 17)
94. Binary Tree Inorder Traversal using stack
94. Binary Tree Inorder Traversal use recursive function
95. Unique Binary Search Trees II
96. Unique Binary Search Trees
98. Validate Binary Search Tree
102. Binary Tree Level Order Traversal submitted in 2015
102. Binary Tree Level Order Traversal submitted in 2018
105. Construct Binary Tree from Preorder and Inorder Traversal
106. Construct Binary Tree from Inorder and Postorder Traversal
113. Path Sum II
114. Flatten Binary Tree to Linked List
129. Sum Root to Leaf Numbers
199. Binary Tree Right Side View
222. Count Complete Tree Nodes
236. Lowest Common Ancestor of a Binary Tree
337. House Robber III
450. Delete Node in a BST
662. Maximum Width of Binary Tree
684. Redundant Connection union find using array
684. Redundant Connection using Dictionary<Int, HashSet>
863. All Nodes Distance K in Binary Tree

Thursday, November 8, 2018

Celebration of 300 solved algorithm on Leetcode.com

Nov. 8, 2018

Introduction


I solved 298 algorithm on Leetcode.com, two more to go to reach 300 solved algorithms. This is the first time I learn to work on practice, allow myself develop good thinking process, develop the skills to a good problem solver.

Tree algorithms


I wrote three medium level tree algorithms, 222, 450, 662.

Medium level tree algorithms (solved 14, total 39, shared 12)
94. Binary Tree Inorder Traversal using stack
94. Binary Tree Inorder Traversal use recursive function
95. Unique Binary Search Trees II
98. Validate Binary Search Tree
102. Binary Tree Level Order Traversal submitted in 2015
102. Binary Tree Level Order Traversal submitted in 2018
105. Construct Binary Tree from Preorder and Inorder Traversal
106. Construct Binary Tree from Inorder and Postorder Traversal
113. Path Sum II
114. Flatten Binary Tree to Linked List
129. Sum Root to Leaf Numbers
222. Count Complete Tree Nodes
236. Lowest Common Ancestor of a Binary Tree
337. House Robber III
450. Delete Node in a BST
662. Maximum Width of Binary Tree
684. Redundant Connection union find using array
684. Redundant Connection using Dictionary<Int, HashSet>

222 Count complete tree nodes

Nov. 8, 2018

Introduction


It is a medium level algorithm. I thought about the optimal solution, and then I read the discuss. I wrote the solution to make sure that I understood the solution, and also I gave the algorithm to my interviewee at 10:00 PM mock interview on interviewing.io.


Tuesday, November 6, 2018

Time to control weight

Nov. 6, 2018

Introduction

I have to start to control my weight again. I am over 190 lb but I have to put some efforts to control the weight. I need to do some more analysis and figure out some cheap way to lose 5 lbs.


How to Spot the 9 Traits of Borderline Personality Disorder

Nov.6 2018

Introduction


I like to study this 27 minutes video called borderline personality disorder. It is hard for me to learn those 9 traits, and I like to learn those things in English version.

9 traits


It is so interesting to learn so many things in 30 minutes.




My 9 years as a software programmer

Nov. 6, 2018

Introduction


Last few days I studied the great educator Yu minghong and his philosophy to help young graduates to find job. He gives out talks and answer questions how to find a job after graduation. I learn a few ideas from his talk. I like to write a blog to memorize my 9 years as a software programmer.


38 medium level math algorithms

Nov. 6, 2018

Introduction

It is time for me to prepare to work on 38 medium level math algorithms.

27 medium level string algorithms

Nov. 6, 2018

Introduction


It is time for me to work on 27 medium level string algorithms. Medium level algorithms are my playground. I am not afraid to make mistakes and learn something new.


48 array medium level algorithms

Nov. 6, 2018

Introduction


I am planning to work on 48 medium level array algorithms.

24 medium level tree algorithms

Nov. 6, 2018

Introduction


It is time for me to work on medium level tree algorithms. There are 24 medium level tree algorithms I can work on.

24 medium level tree algorithms


I like to prepare to work on 24 medium level tree algorithms.

Solved medium level tree algorithms


I solved 14 medium level tree algorithms.
Medium level tree algorithms (solved 14, total 39, shared 12)
94. Binary Tree Inorder Traversal using stack
94. Binary Tree Inorder Traversal use recursive function
95. Unique Binary Search Trees II
98. Validate Binary Search Tree
102. Binary Tree Level Order Traversal submitted in 2015
102. Binary Tree Level Order Traversal submitted in 2018
105. Construct Binary Tree from Preorder and Inorder Traversal
106. Construct Binary Tree from Inorder and Postorder Traversal
113. Path Sum II
114. Flatten Binary Tree to Linked List
129. Sum Root to Leaf Numbers
236. Lowest Common Ancestor of a Binary Tree
337. House Robber III
684. Redundant Connection union find using array
684. Redundant Connection using Dictionary<Int, HashSet>



Memory loss study

Nov. 6, 2018

Introduction


I start to make a small talk about memory loss I experience with my friends. I like to write a blog related to memory loss, and how I can help myself to overcome this weekness in my study and work.

Memory loss



Yu Minhong TED talk

Nov. 6, 2018


Introduction


It is time for me to share the interview with my friend. So I have to choose an English version. 


俞敏洪微博

Nov. 6, 2018

Introduction


I like to spend some time to read blog written by 俞敏洪. Here is the link.


俞敏洪:逆袭的中国教育造梦者

Nov. 6, 2018

Introduction


It is the thirty minutes interview called "俞敏洪:逆袭的中国教育造梦者". I like to spend 30 minutes to watch the video. I like to get some good ideas from the interview.




My personal finance sharing

Nov. 6, 2018

Introduction


It is the first time I came out the idea that I should share my personal finance mistakes and lessons I learn. The idea to share is to push myself to get organized, I like to become a more efficient person.

Case study


I did not remember that I had a loan application back in 2011. Last weekend I reviewed all the paper work and then I found the paper copy my loan application from Scotiabank.

Here is my github personal finance folder, it is a small adventure. I saved under my private repository first, and then I made a copy on my public folder.

I plan to spend some time to figure out what was happening back to me in 2011. How come I did not take it seriously and then I did not make any home purchase at all.

Monday, November 5, 2018

Month for personal finance

Nov. 5, 2018

Introduction


It is the first time I like to make November as my personal finance month of each year. I like to get organized and review all my records related to finance.

Motivation


I reviewed loan paper work I had in 9/17/2011, I chose not to get the mortgage for a condo in the city of Surrey, I got approval for the loan $120,000.00, maximum $190,000.00.

I found the paper work last weekend when I went over all the paper work I had. I found the paper copy. I plan to take a picture and save an electronic copy, check in my github private repository.  I like to remind myself get organized all the time, build a good habit to focus on most important things.

Here is the github folder to share my personal finance learning. I like to share my journey how to understand economical recession in 2008, and then worked on Ph.D. research as part time student from August 2008 to April 2010.





俞敏洪:我的财富观

Nov. 5, 2018

Introduction


It is 60 minutes talk how to handle wealth. I like to take some notes here since I really learn something from the talk. Here is the link.

Wealth


The founder told a very good story about how he managed the public company in education area. Last 10 minutes he also talked about how he handles the wealth, he likes to invest those young entrepreneurs to succeed.


Langley road trip

Nov. 5, 2018

Introduction


It is never too late for me to learn a city called Langley, I took a road trip and drove on fraser highway to the city of Langley from the city of Surrey.

687. Longest univalue path

Nov. 5, 2018

Introduction


It is my favorite interview algorithm. I like to explore all kinds of ideas to solve the problem. Recently I had chance to learn a new solution through the mock interview as an interviewer. I like to try the idea by myself, and also I like to share the idea with Leetcode discuss.

My practice


Here is my discuss link with my practice C# code.


Sunday, November 4, 2018

Wang xiaoping - How to find a job after graduation?

Nov. 4, 2018

Introduction


It is the very good topic to talk about "How to find a job after graduation?". There is a case study talking about a young graduate talking about difficulty to find a job.

Here is the link.

就业竞争力 -> 行业竞争力

Wang qiang

Nov. 4, 2018

Introduction


It is time for me to study Wang qiang. Here is the link. I like to spend time to watch five minutes video. Here is the link called "Good investment decisions should only take 10 minutes".

Xu xiaoping interview

Nov. 4, 2018

Introduction

It is 30 minutes interview. I spent time to watch the video. Here is the link. Here is the profile of xiaoping xu.



Life without retirement saving

Nov. 4, 2018

Introduction


It is a very good topic to study called life without retirement saving. The link is here.


How to use debt to create passive income

Nov. 4, 2018

Introduction


It is time for me to explore another area of problem solving. I notice that I need to learn good debt, so next time I will adapt better based on my study of my own behavior. I missed the chance to purchase a home in the city of Surrey from 2010 to 2016, price around $130,000 condo brand new, since I could not understand good debt and passive income. I wrote a blog called woman to adapt.

Take some note


5% interest
Credit card
Cars
College

Rental property

10%

If you pay over 100,000 dollar to get a college but you cannot get a job. The debt is not good. ROI is low. A lot of students fail to pay back student loan in USA.

Money talk over 1 million view

Nov. 4, 2018

Introduction


It is the criteria I like to choose for my study this Sunday since I have to go to church at 11:30 PM. I like to choose those videos with over 1 million view.

Woman to adapt

Nov. 4, 2018

Introduction


I have a very challenging life and I like to write a story about it. I like to choose the topic called "Woman to adapt".

The timing


I came to Canada in 2010, and at that time I left Florida, a home with $58,000 home equity line open with interest rating 2.5%, and I took $30,000 from the line and landed in Canada as an immigrant. At that time, I could easily buy a condo one bedroom with the price $130,000 in the down town of Surrey. I got a programmer job in June 2010 two months after I came to Vancouver. I can get over $20,000 from my home equity line for the down payment.

I missed the chance to own a home in the city of Surrey. I had some concerns, but I did not talk to friends, I did not write down, and I did not analyze very well with any blog or research document.

Boca Raton and Surrey


Boca raton is the city I lived from 1984 to 2010. And then Surrey is the city I planned to purchase a home from 2010 to 2018.

Here is palm beach property appraiser link. And here is British Columbia's property appraisal.

Woman to adapt 


I will be the woman to adapt, and I like to learn how to adapt better this time after 8 years.

I need to adapt and understand the value of property in Canada. I like to write something to remind myself, adapt myself, prepare a check list, and write down questions, find help through youtube.com videos, get some help and ideas.

Learn to live with good debt


I have to learn how to learn to live with good debt, specially home equity loan is such a good debt, since from 2010 to 2017 I paid less than 2.5% interest rate from my US home equity line. 




How much time I can afford to educate myself?

Nov. 4, 2018

Introduction


It is very good practice to watch youtube.com video related to investment and entrepreneurship. I like to plan to spend more time to educate myself.


Google talk: The simple path to wealth

Nov. 4, 2018

Introduction


It is 40 minutes talk called The simple path to wealth. I spent time to watch the video. The link is here. The blog is here.

Question and answer


49:00 - 53:00/57:44
Question: Keep Google stock.
Answer: separate emotion from investment.


Saturday, November 3, 2018

Investsimple instagram

Nov. 3, 2018

Introduction

It is time for me to study one instagram account called investsimple. Here is the link.

How to earn passive income?

Nov. 3, 2018

Introduction


It is very good topic called passive income. I learn the term today, and here is 26 minutes video for me to study. I like to take some notes from the video.

Passive income


It is time for me to learn something about how to make passive income.



935. Knight dialer

Nov. 3, 2018

Introduction


It is the weekly contest 109. I spent over 60 minutes to work on the algorithm, I submitted the solution six minutes after the contest since the internet was down.

My practice


I like to look into my thought process, and I started to code an iterative solution, but I failed. And then I moved to write a recursive function, I talked to myself to make N = 1, 2, 3 work first; and then I came cross the time out when N = 19. I knew that there is timeout issue. And then I wrote a dynamic programming solution

Actionable Item


I like to solve the algorithm in less than 10 minutes. I spent so many time to work on similar algorithm since I helped a friend to review Google phone interview. Here is the blog. Here is my discuss link on Leetcode.com.




The most important is that there are only 10 possible states. I will look into discuss on the algorithm and then learn a few more ideas to solve the algorithm.



Weekly contest 109

Nov. 3, 218

Introduction


It is weekly contest 109 and I solved the first algorithm. I did finish second algorithm but my internet was down and I could not submit my second algorithm.

My performance


Here is my performance.



Here is the link of my first algorithm's discuss link. Here is the second algorithm's discuss link. I also shared the content in my blog in March 2018, here is the link.

Actionable Item


I need to learn to quickly adapt to the contest challenge, I need to evaluate all possible issues in the second algorithms, and then come out clean and simple solution. I wasted time to write code more than 30 minutes in the contest.

Even though I came out the idea using dynamic programming, I still do not write optimal solution using space O(10) instead of O(10 * N).

I found a role model for the second algorithm, here is the discuss link.


10 easy level linked list algorithms

Nov. 3, 2018

Introduction


It is time for me to write a few words about my experience to work on 10 easy level linked list recently.

My practice


Here is the algorithms.




10 medium level linked list algorithms

Nov. 3, 2018

Introduction


It is the first time I devoted myself to work on medium level linked list algorithms. I solved around 10 medium level algorithms in one week, I like to write down what kind of learning experience it is.

10 medium level algorithms


It is a good idea to work on linked list algorithms in the same time. I can explore all kinds of problem related to linked lists.


A few words for three impressive algorithms



Winter safety study

Nov. 3, 2018

Introduction

It is time for me to do some study about winter safety in the city of Vancouver area. A few years ago I fell on black ice and hurt my hip badly, even though I did not need to visit the doctor, but I learned the lesson not to wear rain boot to walk on icy road.


From easy level to medium level

Nov. 3, 2018

Introduction


It is time for me to evaluate myself how to advance my problem solving skills. How cool I can take failures and then find ways to improve myself. Last 4 months I finished 170 easy level algorithms on Leetcode.com. I know that I can repeat the effort and then work on another 170 medium level algorithms.

Adapt to medium level algorithms


I learn the importance for me to learn most basics through the practice. I know the difference when I perform under pressure.

I really like to practice those medium level tree algorithm, linked list and also math and array.

To work on easy level algorithm, I learn how to be humble and learn the most important skills to survive as a software programmer. To work on medium level algorithms, or move to hard level algorithm, I should be inspired myself to work hard and smart, learn to meet those algorithms at least once, write once.

I have to work on those numbers, I have to make sure that I will meet those algorithms at least once. If I can do that, I certainly like to save time, start from high percentage passing rate, and then finish those algorithms first.





dailyworth.com

Nov. 3, 2018

Introduction


It is my job to give myself some reading assignment, I need to keep reading and also learn something. I choose to read the website with a lot of tips called dailyworth.com.

Investing


I like to read all articles tagged in investing. Here is the link.



Gabrielle bernstein

Nov. 3, 2018

Introduction



It is my job to plan some good program for me to learn more English and also some wisdom about finance, I chose to study one person this weekend. It is easy for me to learn, since there are so many good videos for me watch.

Videos to watch


I like to choose some videos to watch, and I like to integrate my learning with good videos from youtube.com.

Last weekend I felt so isolated since I do not watch any videos for entertainment at all. Now I think that I need to catch up some coaching videos instead. I do not need too much entertainment videos.


Amanda steinberg - 30 minutes video

Nov. 3, 2018

Introduction


It is time to challenge me to do some research about Amanda Steinberg. I am not sure how to approach my weekend study project, I like to spend 30 minutes to watch the video first, here is the  link called "How to master your money & set yourself free with Amanda steinberg".


How to get smart in management of personal finance?

Nov. 3, 2018

Introduction


I spent over two hours this Saturday and look up all the paper work I had last 20 years, including 9 years purchases. I know that I had to learn to get better organized, so I keep all paper copies. What I did next few weeks is to take photos and then check in github.com, so I can learn from my own experience.

Get organized


I did some study about my china vacation trip, I spent over $3,000 Canadian dollar for one month vacation in 2012, at that time, $3,000 Canadian dollar I can pay for 200 square foot condo in the city of Yichun.  I regretted that I wasted so much money on food, clothing, and all kinds of gifts, I saved first two years in Canada, instead of using money to pay my first home in Canada, I chose not to purchase a home, instead I wasted money on a trip or other things.


How to find good mentors through youtube.com videos?

Nov. 3, 2018

Introduction


It is so hard to review those receipts I paid last 9 years in Canada. I passed so many good opportunities to invest and chance to learn, and it is time for me to catch up learning.

Case study


I did one talk to Scotia bank loan officer since she visited the Willingdon church small group in 2011; I talked to a loan officer very often since she was in the same small church group, but I did not learn enough about real estate and loan from her. But I spent over 20 trips to USA cross board to shop clothing and gifts in Bellingham city.

My analysis 


One thing is to find some good and easy to follow mentors through those youtube.com videos. Since I am too busy and I also like to invest a lot of time to do programming, I like to keep learning. The life is much hard for me to handle since I am too afraid to take any risk at all.


Why I choose youtube.com instead of netflix


I subscribe netflix last 5 years, even though I did not watch that often. I found out that I need to catch up learning using youtube.com. I need to adapt my learning skills through programming, and apply the learning to those videos through youtube.com

Worry and scary in 2011


I spent three semesters to pay my Ph.D. study from 2010 to 2011, I paid US dollar and then stopped the program after three semesters. At that time I was so afraid. I did not have confidence to learn things by myself outside university, through real challenge in the daily full time job.

But I did not know that if I invest those $2,000 tuition into Amazon stock, in 2011, I may get 10 times investment back.

5 "Good investments" that are actually total scams

Nov. 3, 2018

Introduction

It is 14 minutes video called "5 good investments that are actually total scams". Here is the link.

7 extremely lazy ways to make more money

Nov. 3, 2018

Introduction

It is a 13 minutes video and I like to watch it a few times. Here is the link.


Friday, November 2, 2018

7 insane ways Americans waste money

Nov. 2, 2018

Introduction

I like to watch the video again, it is called "7 insane ways Americans waste money". Here is the link.

Celebration of 289 algorithms solved

Nov. 2, 2018

Introduction



It is challenging to write a blog using this topic "289 algorithms". I like to spend ten minutes to write a story about it. I just solved 289 algorithms on Leetcode.com. It is time for me to celebrate and then I like to write down my thought process to achieve this goal.



289 vs 100


I have been worked on Leetcode since January 2015, I started to work on algorithms on Leetcode.com and then learned so many ways to improve myself. I think that the learning experience is valuable, but one thing is missing. I only completed around 100 algorithms after three years six months.


Last four months, I started to work on algorithms. I always try to find easy level algorithms first. I like to solve more problems. Now today I solved 289 algorithms.

I still have over 20 easy level algorithms to work on. Those algorithms are bit manipulation, and other things.


Why number matters?



It is hard for me to measure myself; I have to journal my practice and then I found out that I do not know what it matters most. It is the number of algorithms I solve. I need to get those experience as top 5% players does. Top 5% is related to ranking 3300 out of 70,000 player.


I read a player with over 5466 submissions, and I did read Javascript submissions. I have to think about how I can find time to work on my JavaScript, my favorite language.

Here is my blog related to leetcode book.

The following is the comparison. A player knows to solve more algorithms, and also more than 5,000 submissions. My profile is the right side, with 289 solved algorithm, 1039 submissions. The player has more than 4400 submissions and solved more than 245 algorithms.


The medium level algorithms are my playground, I do not plan to get any interview right now in next 20 months. I just like to explore those algorithms and find something interesting to work on.

Blogging is just the beginning


It is the tip I learn from tennis sports coaching. Journal your practice. But blogging is just the beginning, after three years six months blogging starting from January 2015, I found out that I did not make enough progress in terms of problem solving skills.

I had to take a private coach in June 2018, and then got his advice on working on easy level algorithms first. I did not have strong competitive history and it makes me hard to figure out what is the next.

I have to work on those numbers, number of solved algorithm, total submissions, and I have to work hard to get more experience through those algorithms on Leetcode.com platform. 

Thursday, November 1, 2018

19. Remove nth node from end of list

Medium level linked list
19. Remove Nth node from end of the list
24. Swap nodes in pairs
92. Reverse linked list II
138. Copy list with random pointer The elegant solution
143. Reorder the list 
147. Insertion sort list hard to write but is readable
328. Odd even linked list
445. Add two numbers II
817. Linked list components using hashset

92. Reverse linked list II

Medium level linked list
19. Remove Nth node from end of the list
24. Swap nodes in pairs
92. Reverse linked list II
138. Copy list with random pointer The elegant solution
143. Reorder the list 
147. Insertion sort list hard to write but is readable
328. Odd even linked list
445. Add two numbers II
817. Linked list components using hashset

24. Swap nodes in pairs

Medium level linked list
19. Remove Nth node from end of the list
24. Swap nodes in pairs
92. Reverse linked list II
138. Copy list with random pointer The elegant solution
143. Reorder the list 
147. Insertion sort list hard to write but is readable
328. Odd even linked list
445. Add two numbers II
817. Linked list components using hashset

328. Odd even linked list

Medium level linked list
19. Remove Nth node from end of the list
24. Swap nodes in pairs
92. Reverse linked list II
138. Copy list with random pointer The elegant solution
143. Reorder the list 
147. Insertion sort list hard to write but is readable
328. Odd even linked list
445. Add two numbers II
817. Linked list components using hashset

Wednesday, October 31, 2018

How to turn $10 into $100

Oct. 31, 2018

Introduction


It is a short video called How to turn $10 int $100. I like to take some notes here.

Rules


1. Buy low sell high
2. Max margin
3. Min costs


10 things you should never buy

Oct. 31, 2018

Introduction


It is a good video to watch. Here is the link of the video.