Saturday, October 13, 2018

Does my failure on Leetcode 150 easy level algorithms has a name?

Oct. 13, 2018

Introduction


It is time for me to spend 10 to 30 minutes to go over those failed submissions on 150 easy level algorithms. I like to identify what I should be careful, the growth pain of the algorithm and data structure problem solving. Like a baby growing up in the first year, there are numerous stages an infant can continuously develop. This is the first time I intensely work with the online judge, and work with those problem statements and problem setters, and also work with those hidden test cases which may never be released but may explode any time.

Common mistakes 


I make common mistakes very often. I just could not believe that I learn so much and so quickly through those easy level algorithms.

Sometimes the algorithms are labelled by the mistake as an easy level, but then I just fell in love with the algorithms and continue to learn from my experience. I choose the algorithm to be my mock interview algorithms more than five times.

Most surprisingly I learn a few solution with such elegant solution. I just could not believe that I need to refine my thinking process, and then rework the problem after my first submission by working independently.

I will list over 5 mistakes and lessons I learn in the following later.

687. Longest univalue path with design flaw, pass 43 out of 68 test cases
687. Longest univalue path copy the idea from most popular post
Array easy level algorithms (solved 44, shared 24)

867. Transpose matrix - pass 29/36 test cases
Math easy level algorithms (solved 27/ 32, shared 12)

415. Add Strings recursive version - memory limit exceeded
415. Add Strings Iterative solution - learn to use for loop creatively
String easy level algorithms (solved 32, shared 15) 
680. Valid Palindrome II 418/460 test cases passed Time limit exceeded
686. Repeated String Match memory limit exceeded for last test case
686. Repeated String Match memory limit exceeded for last test case
Hashtable easy level algorithm (solved 25, shared 21)

204. Count Primes verbose code
204. Count Primes elegant version

242. Valid Anagram One more mistake to remind me to work on easy level

500. Keyboard Row do it myself
500. Keyboard Row use HashSet API IsSubsetOf

645. Set Mismatch first submission - XOR
645. Set Mismatch elegant one using XOR two places
645. Set Mismatch use bit manipulation trick

720. Longest Word in Dictionary use hashset
720. Longest Word in Dictionary use Trie data structure
720. Longest Word in Dictionary use Trie data structure
720. Longest Word in Dictionary use Queue data structure
720. Longest Word in Dictionary use recursive function
Medium level (solved 53, shared 4)


915. Partition Array into Disjoint Intervals use three iterations
915. Partition Array into Disjoint Intervals one pass idea discuss
916. Word Subsets using counting sort
916. Word Subsets discuss
918. Maximum Sum Circular Subarray pass 98/108, in the contest
918. Maximum Sum Circular Subarray after the contest, working code
919. Complete Binary Tree Inserter O(1) insert
919. Complete Binary Tree Inserter Using Queue
919. Complete Binary Tree Inserter Using Queue
923. 3Sum With Multiplicity
923. 3Sum With Multiplicity dynamic programming solution 
Medium level tree algorithms (solved 14, total 39, shared 12)

102. Binary Tree Level Order Traversal submitted in 2015
102. Binary Tree Level Order Traversal submitted in 2018
Hard level (solved 33, shared 5)

37. Sudoku Solver
76. Minimum Window Substring One thing a time
85. Maximal Rectangle
239. Sliding Window Maximum optimal solution using LinkedList
239. Sliding Window Maximum All submissions, SortedSet, timeout

A name


I like to give those mistakes a name to encourage myself to work hard, work on more algorithm problem solving.

The name is called in Chinese, "这需要托大家的福,托大家的福就要吃百家饭、穿百家衣". The custom is to help raise a healthy child to eat and wear in so many families. The link is here.


Sports watch

Oct. 13, 2018

Introduction

It is one of my research area in hackerthon hosted by Microsoft called ""complex health needs". I work with a small group, I was told to read the article related to withings steal HR-up to 45 days, I found the article to read. Here is the link.

Case study of 150 easy level practice

Oct. 13, 2018

Introduction


It is the first time I dedicated three months to work on more than 150 easy level algorithms on Leetcode.com. I like to compare this study with 2 weeks paid coach session with my ex-coach, any course I took in graduate school, independent study, pluralsight.com course study, webfrontend.com course study, and any other things like project at work.

It is a learning process 


I like to make this learning process public for people to access, so I came out the idea after 2 months work. I decided to share as many as possible leetcode algorithm C# code I wrote. Here is the github page I created for myself, to stay organized. It is easy to access for public as well.

I also move my writing from my coding blog to Leetcode discuss. There is nothing to be afraid, I wrote down what I like to share, what will be helpful for others to learn from my experience.

My reputation starts to increase the value, when I started to work on easy level algorithms, my reputation is 3, now it is 13. Although it is 10 reputation gain, I like to apply customer obsession leadership principle. I constantly review my publication, and also need to rewrite and revise. I definitely am more active to read other's sharing, since it is in the community. It is so easy to go to other's sharing compared to my blog, instead I move to my other blogs, I read my own blogs again and again, or hours long, it is time waste. Instead I learn new ideas quickly, I become Leetcode discuss reader, I am more open to new ideas, quickly find good role models in those players.

It is over thousands view quickly from my post on Leetcode.com, those views are more specific for those algorithms players. Compared to the view I get from my blog, I directly serve the community of Leetcode discuss. I think that is more efficient and also push myself to the next stage to serve the community.

Easy level algorithms training


I have rough ideas how to strength myself in algorithm and data structure. The idea to hire the coach and work with the coach in two weeks, I understand the idea to follow the leadership of those hard working people, submission over thousands, solved more than 500 algorithms. I like to be one of them.

My target is changed, I am aiming to how good I can practice and communicate through Leetcode discuss or public, instead of aiming at top software companies interviews, nice and challenge job positions.

I also like to compare last three months training comparing to the last three years. What I did last three months are more focus, easy level only. I also work on the algorithms by category only, I have more focus and also enough training for one specific area.

It is also a good habit to build, I have to pay attention to my submission, my solved algorithm. I have to define those metrics to watch, and learn how to compare to role models with thousands submissions in last 12 months.

I like to learn that I am more confident and also stay on the track. I learn to monitor my stress level or emotion about the hard work, long hours study and problem solving. I learn to adjust my expectation based on my metrics.

One statement is to let me make over another 500 submissions, show the world I am working on the basics. Even though this time I have to work on medium level algorithms instead.

Comparison highlights


The practice is easy to work on, easy to track the progress, easy to reach out the community, and also easy to get feedback from online judge. I also find that it is also very helpful for me to find my weakness, in terms of reading skills in English, how to evaluate the use cases and also simplify problem solving.

I am definitely more confident to work on things so easy, also I learn to how to craft my code much more elegant ways in a few cases through hundreds of cases. I do find that talent do make big difference, there is big gap between me and top talent in the world.

The practice is no fee associated. And the time I spend on the practice, I find that it is more rewarding in terms of problem solving, coding craft skills. I definitely have ideas how to make better decisions and learn to evaluate my way of education resources and challenges.



Friday, October 12, 2018

I think that I am ready to be a super interviewer

Oct. 12, 2018

Introduction


It is my 10:00 PM mock interview as an interviewer. I gave the algorithm to the interviewee to work on, the algorithm is called binary tree inserter. I worked on the algorithm last Saturday, I came out the idea but I was not able to implement the idea. I had excuse since I played four hours tennis before the contest, I was too exhausted and I did not eat an orange, I had some headache when I worked on the contest.

Today I came cross the interviewee and observed the first eight minutes her performance. And she told me that she likes to try to use level order traversal, using kind of math to figure out how to do insertion, or using a Queue to implement the idea. She wrote the code and asked a few questions, I definitely could tell that she was very competitive and very good at communication.

The most important words I heard from the interviewee was the following:
I have two ideas to solve problems. Let me go over two of them.


Good programmer


How can I tell that the programmer is a top talent programmer? I can tell from what she said, how she approached the problem? And how she handled the problem solving in general. Of course, I also can tell from the code she wrote.





Can I find time to solve 100 medium level algorithms?

Oct. 12, 2018

Introduction


It is hard for me to find time to write code recently. I was busy to review my bank statements last 8 years from Chase bank in USA, and I like to review my rental history.

But if I do work hard, and I can solve another 100 or 200 medium level algorithms in next 45 days or 3 months. I do believe that I will find ways to solve another 100 hard level algorithm as well.

So my short research is how I can find time to solve 100 medium level algorithms on Leetcode.com.

Find time to study first


It is a good time to study 10 medium level algorithm a day. And also I like to encourage myself to learn one algorithm a time. 




It is tough but more submissions will help

Oct. 12, 2018

Introduction


I cannot wait to work on new technology and try all kinds of web technology, and write very fashion website for the business. But I like to hold on learning new technology. I like to spend next 45 days to work on over 100 medium algorithms first.

Medium level algorithm


It is so hard to build a good habit to write code every day. I think that it is easy and very enjoyable experience to work on Leetcode algorithms for me. Every 10 or 20 minutes I will learn a new idea through Leetcode discuss panel, all I can do is to rewrite the code.

Sometimes I do not think about carefully. I have to submit multiple times in order to understand the idea. I did this one using binary tree inserter, I submitted three times using Queue idea.

This year we have 78 days left. I really like to write code for a lot of algorithms. I like to learn various ideas  to solve medium level algorithms, so hard level algorithm will not be so tough later on.


Can I learn react in one day?

Oct. 12, 2018

Introduction


It is my research how to work on react in one day. I like to read this post carefully.

Leetcode algorithm analysis

Oct. 12, 2018

Introduction


It is a good habit to study leader board after Leetcode weekly contest. I did spend half hour to look into top 50 profiles of Leetcode weekly contest 105. I found one profile with Leetcode algorithm analysis. Here is the github page.


Good practice


I believe that if I can practice very good, the performance in the contest or onsite interview will definitely very competitive. So my goal is to work on my practice.

The player did some work, and then categorized the algorithms by topics. I plan to study some algorithms later.



How to work on Leetcode algorithms?

Oct. 12, 2018

Introduction


It is my favorite topic how to work on leetcode algorithms. I found a blog on 1point3acres.com, and then I like to share some notes here.

How to work on Leetcode algorithms?


I like to share some notes here. Here is the gist I created based on the blog. 

Easy 10 minutes, medium 20 minutes, hard level 30 minutes. If I cannot complete, then I plan to use easy level 5 minutes, medium level 10 minutes, hard level 15 minutes to read discussion board.

Thursday, October 11, 2018

Canada retirement research

Oct. 11, 2018

Introduction


It is time for me to study more about Canada related to retirement income. I came cross this article and I like to write a blog about it.

Understand the basics


I like to copy some content here in Chinese. I like to find some keywords and then look into more details.

 1,加拿大退休金计划(CPP)---要上班才有的,CPP是计入年收入的。
  · CPP是根据以往工作时缴纳的费用而定的, 最高是$1012.5/月.最早可以于60岁的时候申请, 但比65岁申请,要按比例扣减. 也可以70岁再申请,同样将按比例增加。CPP的领取不限身份和居住地, 只要你缴过, 够年龄后,你就可以申请, 哪怕你到时候居住在外地都可以.
  · 你能领取多少退休金取决于你向CPP供款额的大小和时间的长短。 如果你在2013年65岁退休, 每月可领取的最高退休金额是$1012 。但很多人那不到这个最高值。实际上加拿大人今年所得的CPP平均值是$528。我们估算了一下,这个平均值大致相当于过去十五年每年按最高许可额供款的情况。
  · 此外,你也可以在60岁时就领取退休金,但退休金将比65岁的减少约30%。反之,如果你在70岁退休,退休金将比65岁的增加30%。
  · 由此看来,我们能从CPP得到的退休金十分有限,期望值高的人要调整一下了。
  · CPP是公共退休金,主要是给了给低收入者提供退休生活保障,这是加拿大社会保障制度的一部分。
  如果你终生的工薪收入都高于社会平均水平,那么可能你退休以后领取的CPP价值总额会低于你工作时为CPP所做贡献总额。
  除退休保障外,CPP还有其他一些重要的保障功能:
  如果你不幸因伤病失去工作能力,你可以从CPP领取最高每月1,212.90,你的孩子还可以领取最多每月228.66。
  如果你不幸早逝,你的家人可以从CPP一次性领取最多2,500,你的孩子可以每月领取最多228.66。
  这个一个提倡扶老携幼的社会。
  如果你收入很高,缴纳很多的CPP,身体又很好,那么恭喜你,你不需要社会的帮助,还有能力帮助他人,你很幸福。

Wednesday, October 10, 2018

Review my research about Vancouver area house market

Oct. 10, 2018

Introduction


It is time for me to review all past eight years activities related to house research, and then it is also important for me to write a blog. I like to write some topics and help myself to understand better about business, life and career.

I moved to the city of Vancouver in 2010, and started from 2010 I rented a small place in the house in the city of Vancouver last nine years.

A complete research


I like to define a complete research. It should include down payment, house market research, loan research and also new immigrant loan policy, and it can include more activities.


Actionable Items


I like to mark this day Oct. 9, 2018 as day one of my personal finance research. It starts with a seed, an idea to look into.




Business management

Oct. 10, 2018

Introduction


It takes hours for me to review my Chase bank statements from 2011 to 2018 last few days. I did study those bank statements, and then looked into my last 8 years rental management every year by going over all emails in Gmail.  I did so many things related to rental business, I learned so many lessons and worked so hard to make it a successful small business.

It is a small business, in order for me to improve my management skills, I like to write a blog as well.

Small business


I do think that the small business keeps me active in Chinese community and also helps me to be a person with Christian faith.

I did a fantastic job to learn to run a small business. I will write down a few things I did very good first.

Good things 


I do not waste the resource. The most of time the two bedroom are rented from 2010 to 2018.

Mistakes 


I also made a lot of mistakes.

One of my biggest mistake is that I can make big difference to save $6000 US dollar interest in the home equity loan from 2010 to 2017, since I can pay it off, the money saved in Canada bank did not generate any meaningful interest.

I am lack of confidence to live a life from paycheck to paycheck in Canada. Even though the saved interest is such a great reward right away.

I should spend at least 40 hours every year to review all the bank statements first, and document very well all activities.










Monday, October 8, 2018

Jeff Bezos shares his management style and philosophy

Oct. 8, 2018

Introduction


I like to take some notes from the video sharing. Here is the video link.

My notes


Here are my notes.

Gift, study hard, your choice, hard work


Look back your life, you will be very proud of yourself. Your choice to work hard. Gift is given to you.


Leaders are right a lot

Right a lot, listen a lot, change a lot. Work very hard, unnatural, trap you anything you set in the path. The life is complicated, reanalyze the situation.

Dramatically underestimate the complexity of the work we are living.

Innovation and failure

It is not an experiment. Most innovation is through trial and fail.

Two pizza a team

Tell each other a story. 10 or 12 people is a perfect size for human interaction without a good structure.

6 pages of memo, no powerpoint

Run a meeting. Come in, first half hour study, study 30 minutes together. After half an hour, we talk together.

Author clarifies his own thinking to write a memo.


919. Complete Binary Tree Inserter

Oct. 8, 2018

Introduction


It is a medium level algorithm in the weekly contest 105. I decided to write a few ideas after the contest.

My practice


Here is the discuss link I posted using the idea learned from one of discuss after the contest.
Here is the discuss link I posted using Queue.
Here is the discuss line I posted using Queue. It is so easy to learn the idea, but it was so hard for me to write the code and I failed four times before the code passed the online judge.


Let us get some data


Here are my submission record. Today is Canada thanksgiving holiday. I spent time to stay in my home office, I practiced the algorithm using three ideas.



Here is the discuss line I posted using Queue. It is so easy to learn the idea, but it was so hard for me to write the code and I failed four times before the code passed the online judge.

I submitted four times from 33 minutes ago to 11 minutes ago. 


918 Maximum sum circular subarray

Oct. 8, 2018

Introduction


It is a medium level algorithm. I had chance to work on it in the weekly contest. And then I spent time to fix the bug and submitted another solution.

My practice


Here is my submission.


House market study

Oct. 8, 2018


Introduction


It is time for me to write down some article written in Chinese,  I may spend some time to read carefully and think carefully what I can do. The article is here to read. Another article is here to read for me as well.

China and house market


如今,在三四线、小县城房价近万破万实属正常现象,月赚两三千小镇青年也已集体过上了“百万身价”的生活。
上面出了一招把戏,为了三四线和县城的库存问题,上面于2005年首次提出了棚改政策:
棚改的地方不分配回迁房,只给钱或者房票。
没了房子的棚户改造区的人们只能被迫拿着房票
就必须去房地产市场,
因为购买需求的骤增,
房价闻声而涨。
套路简单,清晰,有条理,很明确。

数据显示,2017年全国棚改户数为515万套,涉及20个省份的三四线城市。按照PSL支持棚户改造的贷款余额计算,平均每户补偿到50万元。而以平均数来看,每个省份棚改三四线城市为10个,相当于每个城市2.6万套,每套50万,杀入该三四线城市房地产市场的钱就到了130亿。房价怎么可能不飙上去呢?

写到此,可能有人会问,棚改政策助涨三四五线城市房价的目的在哪里?意在为地方债务解压。
当房价暴涨,活跃的楼市成交会为当地政府带来大量的交易税收。更主要的是,楼市成交火热后,当地的地价会暴涨,可为当地政府带来巨额的卖地收入,因此地方债务压力便可缓一缓了。
从2017年开始,房价就出现了百年难遇的奇怪现象:
一线城市的房价开始稳定,
二三线尤其是三四线城市的房价却突然坐上了火箭一路上扬。
现在,全国小县城的房子几乎都涨到1万元了。
曾经梦想的在一线城市赚够钱就回老家买房,于是终于落空了。
更痛苦的是,今年4月,中国社科院在《中国住房市场发展月度分析报告》中预计,三四线城市房价仍将继续惯性上涨。
与三四五线城市房价暴涨相对比的是,不管是人口还是经济基本面,三四五线城市都正在面临向下的压力。
首先,人口增长层面,大量的三四五线城市人口面临负增长压力。
时下中国人口的数量增长已达顶点。正是基于此,两点趋势值得关注:
A,中国可能于年底取消计划生育政策。
B,各地开始疯狂抢人。
切记,在人口增长乏力背景下,越来越多的城市意识到,人才是城市最重要的资源,于是先下手为强。比如天津、西安。
天津与西安们扔掉底裤地抢人,背后反映的是对未来发展的恐慌。
接下来,伴随中国人口数量增长面临负增长压力,大量的三四五线城市将不得不陷入人口加速流失的困境,这是不可更改的趋势。然而在人口流失压力下,房价却在暴涨,这是正常的上涨吗?
同时,中国经济正在转档期,大量的三四五线城市陷入经济增长乏力困境中。
因此说,不管是人口的负增长压力还是经济的增长乏力,这都与这些城市的房价暴涨形成了鲜明的扭曲对比。
我国居民人均可支配收入不足经济发达国家居民平均收入五分之一,房价已经开始接近或超过发达国家的平均水平。全国房价普遍上涨数十年,房地产市场新调控政策频繁推出,而房价越调越高并没有转变。高房价促进社会系统生活成本不断的提高,现在已经是全民为高房价打工的节奏。
全国200个县城房价超万元,县城平均工资有多少呢?
楼主坐标,四川东部某县(猜测是四川广安或者四川资阳的一个县城),与重庆紧邻,经济水平一般,比上不足比下有余。
上图是一个参考图(四川中上等县城的经济情况,数据是2017年3月份以后的) 
隆昌人口:78万;
人均消费额:1.1万/年;
人均存款额:3万/人;
一套100㎡的房子需要33个人的存款,首付3成,需10人存款。
前几天回家,与表弟一起吃饭。他是县里一名普通公务员,饭间,看他情绪很低落。一问才知道,他们已经两个月没发工资了,原因是县政府的账户已经空空如也。目前,只发了教师的工资,因为以前教师因为工资的事罢过课,所以不敢拖欠。
其实,之前几个月也拖欠过,还好当时卖了一块地给广东那边一个开发商,卖了几千万,人家给的现金,这才发了工资,但这只是杯水车薪,这几千万发完之后,又开始拖欠了。
据他说,退休金、五保户等等加起来所需要的钱,每个月要一亿多,县里根本拿不出钱来。目前,县政府欠银行几百亿,利息都还不起,银行也不愿意再拿钱出来填。
前几任县官,为了GDP,无休止向银行贷款,搞新区,搞工业园。目前的现状是,新区高楼遍地,但却空无一人,工业园到处是厂房,但却杂草丛生,几乎成了废区。
GDP上去了,当官的升迁了,留下来的却是一地鸡毛。现任县长不愿意背锅,几次向市里面请辞,但都被拒绝,领导让他想办法,只要能稳住大局,就是大功一件。但市里也是债务缠身,不给他提供资金。于是,他绞尽脑汁,这才从外地引进了几十家小鞋厂,但因为环保问题,迟迟无法落地。
县里的五保户也已经很久没发钱了,为了稳住局面,县政府不仅不发工资,反而向底层公务员借钱,每人2000元,说是给他们算利息,但目前为止,只有很少的人拿钱出来。
为了找钱,县里成立了一家公司,具体什么公司,我忘了,反正是这家公司发了债券。政府开会,让公务员都去买它的债券,表面上看,这家公司是政府背景,但政府却不给担保,根本没什么人买。
以上就是我们县城目前的现状。
据表弟说,隔壁两个县的情况也差不多。各种新区,各种工业园,他们都欠着上百亿的钱,也没什么可以生钱的办法,就这样拖着,能拖一天是一天。
经济水平一般的县城欠着几百亿,发达的地方估计还不止,全中国有一千多个县,如果按照平均水平来算,我粗略估算了一下,至少几十万亿,县里几百亿,到了市里或许就得上千亿了,按这样算下来,整个政府的债务能吓死人,我真的不敢想象接下来会发生什么。
与美国的“贸易摩擦”是躲不掉了,以前可以靠着廉价的中低端商品出口,还能赚点钱,还能解决一些人的就业问题,但这种“好日子”在接下来几年时间内估计都不会再有。本来工厂的利润就不高,10%的关税,几乎能剥夺掉大部分工厂的利润。老板们只能无奈关厂。
国内老百姓的钱全投到房里了,工厂生产的商品,只靠国内消费,根本无法消化,这么庞大的产能,谁来解决?
目前,该修的已经修完,该建的也建得差不多了。很多建筑工人,厂弟厂妹失业,而且很多家庭还背负着巨额的债务,怎么办?
前些年,我这个时候回家,基本上看不到什么人,都在城里打工赚钱,但今年这个时候,各个村里却多了很多中青年。这些人基本每天都在街上茶馆里面打麻将,无所事事,时不时的到县城里,自己买的房子里住几天,然后又回农村。其实,这种情况,从去年就已经慢慢开始了,只是今年显得特别的多,这些人基本上是不会种地的,也没什么技术,除了下苦力,他们基本上没任何可以谋生的本钱。如果钱财耗尽,再加上各种贷款,他们有可能真的会“铤而走险”,做出违法犯罪的事。
这几天,我一直在想,或许只有一个办法,那就是无休止的在账户后面加“0”,除此之外,无解。但这种方法也只能暂时拖住一段时间,等时间一过,无力回天,只能重新洗牌。全国人民都将为过去几十年的无知和盲目负上沉重的代价,结果如何?可以参考一下委内瑞拉。
最后,给大家一点忠告,目前讨论房价是涨是跌,已经全无意义,我已经不再关注房价了。大家应该担心的是,如果哪天你的工厂,你的公司突然宣布裁掉你或者是倒闭,你该肿么办?怎么还钱?怎么去维持一家人的开销?
这个时间节点,千万不要再去借钱,各种花呗、借呗、信用卡之类的,尽量不要去沾,尽量降低自己的债务水平,勒紧裤腰带过日子,尽量留点余钱,以备不时之需。没买房的也别着急,先租着,再等等看,给家人做做工作,因为你一旦背上房贷之后,你在接下来几的日子将会非常难过。如果社会经济健康,还好说,至少收支还能平衡,但问题是,现在才只是刚刚开始,后面还有更劲爆的。
这些年,总有人说一句话,你们不是天天唱衰吗?为什么还不见衰呢?反而越唱衰越兴旺,我只告诉你们一句古话,“常在河边走,哪有不湿鞋”,今天没有发生的事情,并不代表它不存在,永远不可能发生,或许是它正在积累更大的力量,等待着总爆发。
这就好像洪水一样,有人提醒今天可能会决堤,让大家赶快准备,今天过去了,堤坝完好,大家都笑他是个傻子,都不准备,然后又说,可能第二天会决堤,第二天过去了,还是没有决堤,大家依然笑他是个傻子,还是呆在原地,不做任何准备,而在这个时候,洪水已经越来越猛烈,第三天,洪水淹死了所有人。只有做了准备的人,幸免于难。
请大家记着一句话,我们无法与天斗,也无法与地斗,随时做好最坏的打算。

Sunday, October 7, 2018

When I am tired

Oct. 7, 2018

Introduction


I like to write a blog to memorize my time and experience last Saturday. How did I survive after more than three hours tennis on central park in the city of Burnaby from 12:30 PM to 5:15 PM, went home to attend 6:30 PM weekly contest. I did not give myself enough time to prepare for the content, too tired and need to have nutrition food.

I did go shoping at crystal mall first, and then I got home and only ate a yogurt and a pieces of biscuit, still hungry. I chose to start to work on weekly contest 105 starting from 6:30 PM, without a dinner since no time to cook and eat.

My head hit to the table several times, I had headache. I stood up for a few times and tried to calm down. I came out the ideas for two algorithms, after solved one, but I could not handle the stress to write the code.

My blog is called "when I am tired". Here are highlights.

1. When I am tired, my brain still functions very well.
2. When I am tired, negative thoughts came out. I tried to control, put it down. I thought about I could not handle this stress of problem solving, I will never make it.
3. When I am tired, I actually need some protein to feed my brain and body to recover.
4. When I am tired, I need to know the importance to get back to energetic quickly. Eat some healthy food quickly. An orange fruit will help me a lot.


Let me get memorize the contest


It was a lot of hard work. I submitted one algorithm, came out the idea for second idea but failed the edge case.

And also the third algorithm I came out idea, but I had difficult to write the code. It felt so good, I just practice a few design algorithm, and then I learned to be humble again. The practice taught me the lesson.



Detail performance is here.

Leetcode weekly contest 105

Oct. 8, 2018

Introduction


917 reverse only letter, here is my discuss.

918 Maximum sum circular subarray, here is my discuss.


Saturday, October 6, 2018

Opportunistic learning

Oct. 6, 2018

Introduction


It is a big waste for me last three years, since I do not fully use Leetcode online judge, discuss. I do not have chance to catch up so many algorithms, the number is 909 today.  How should I expedite my learning process?

Base on my existing talent, I can only work on 120 algorithm in three months using Leetcode online judge. I am thinking about to take opportunistic learning, quickly putting most popular discuss and then understand the idea, convert the code to C#, submit the solution.

I like to call this learning as opportunistic learning. In order to fit into learning challenging of medium level and hard level algorithms, as long as I keep learning, I should be able to shorten the time to complete those algorithms.

There are so many good resource through those problem solving, most of algorithms I will never have chance to read and figure out them by myself.

Just an idea, I like to try it using a few hours this weekend.

Learning from failed test case

Oct. 6, 2018

Introduction


I like to document my learning experience today since I worked on Leetcode easy level stack algorithm, design min stack. I did learn to design a stack to save non-decreasing elements in the stack, the online judge just failed my code, I had to carefully think about what is difference between non-decreasing and increasing.

Leetcode online judge is a great tool 


I like to train myself more using Leetcode online judge. Here is my blog about the practice.

I like to write down a few more tips to work with Leetcode online judge.




Friday, October 5, 2018

3 Strategies for Managing Rental Property

Oct. 5, 2018

Introduction


It is time for me to do some research about rental property. As a landlord of Florida condo, I have to learn so many things. It is best time for me to relax and read some articles.

Here is the article link.


50 Things You Can Get For Free!

Oct. 5, 2018

Introduction


It is my research topic how to get for free. I like to learn some basic ideas how to get for free, and then I can think about more. Also it is time for me to improve my reading skills by doing research around money, thrifty, and healthy life style.

Here is the article.

7 Thrifty Effects of a Healthier Lifestyle

Oct. 5, 2018

Introduction


Finally I find some topic so exciting to read and also it is challenging for me to expand my vocabulary. I like to read more and get ideas how to have a healthy lifestyle.

The article link is here.

23 medium level stack algorithms

Oct. 5, 2018

Introduction


It is time for me to plan to work on those 23 medium level stack algorithms. I am really excited to learn something this time.

Stack easy level algorithms

Oct. 5, 2018

Introduction


It is time for me to work on five easy level stack algorithms. Here is the link.

Celebrate my hard work


It is time for me to work on those stack algorithms this weekend. I was so surprised to learn that those algorithms are so challenging. Be humble, be curious.

Let me write down my favorite algorithm, 155. Min Stack. Here is my discuss link. 

Leetcode weekly contest

Oct. 5, 2018

Introduction


It is my interest to advance my global ranking on Leetcode weekly contest. I like to discipline myself to attend the weekly contest every week, so I can learn and get to know more how to advance my performance.

Here is the github page I documented all contests I played so far. I like to see some progress over time.


Current progress


It is very good practice to document current performance. I will come back to review again after three month.


100 great tips for saving money for those just getting started

Oct. 5, 2018

Introduction


It is never too late to start to learn how to save money. I like a few ideas very much. Here is the link of the article.

I like to spend some time to learn ideas from my study. And then I can apply them to my training of algorithm and data structure. I need more ideas for me to work on ideas to get smart, it can be money, it can be time, and it can be relationship.


20 easy ways to save some money every day

Oct. 5, 2018

Introduction


It is so good to read those articles talking about how to save some money. I like to learn how to do it better.

I still cannot control the pulse to spend money. Even though I do not purchase any extra clothes so often, I did spend $1,000 Canadian dollar this June to hire a private coach.

I need to learn how to save money. Meanwhile  I like to get challenged to improve my reading skills. I have to work on algorithm and data structure practice, one of hurdles is my reading skills.

Here is the article link.

Frugal budget, low income and poverty study

Oct. 5, 2018

Introduction


It is time for me to study more about being frugal, how to cut expenses. I think that in order to challenging my reading skills, I like to do a series of research how to save money, living frugal, and how to be poor and happy etc.

One article a time


I like to read a lot of articles and get ideas how to get smart in the weekend, spend money wisely on grocery, and make good plans on other purchases as well.

Frugal budget. I like to read this article.

Happy even when you are broke. The article is here.

6 Ways the Recession Will Change Retirement

Oct. 5, 2018

Introduction


One of ideas to become a top player on Leetcode.com is to improve my reading skills, and analytical ability. I also like to learn how to solve daily problem as well.

I can do something small and simple, write a blog to talk about the article I choose to read. Here is the article called "6 Ways the Recession Will Change Retirement".

7 Ways to Survive the Jobless Recovery

Oct. 5, 2018

Introduction


I like this kind of problem solving ideas in the article called "7 Ways to Survive the Jobless Recovery". The article link is here.

In order to improve my reading skills, I like to do some research on various topic about thrifty leadership principle.

Sometimes I am kind of stubborn. The way I can overcome the problem is to read more ideas, and learn from the recession, jobless, broke, poverty etc.


Thursday, October 4, 2018

Live happily on 75 percent less

Oct. 4, 2018

Introduction


It is my time to do a short research, and also I like to improve my reading skills. The topic is "How to live happily on 75 percent less". The article link is here.


Spend less live well

Oct. 4, 2018

Introduction


I like to do some research called spend less live well. The article is here. I like to learn a few concepts from the article.



Intentional poverty study

Oct. 4, 2018

Introduction


It is 11:26 PM. I like to do some short study about intentional poverty. Here is the article I choose to read. Better off broke, the article is here.



10 other ways to save on rent

Oct. 4, 2018

Introduction


It is time for me to do some research on how to save on rent. Here is the article.


Ideas to live a thrifty life

Oct. 4, 2018

Introduction


It is time for me to review articles related to save money. I have so many regrets to waste a lot of money when I was younger. One way I can help myself is to read the articles every week. I also should write down some notes as well. Specially holiday season is coming soon.

Articles to read


Call me cheap, but I live a rich life. The article link is here.


Time to share tree easy level algorithms

Oct. 4, 2018

Introduction


I solved 31 easy level tree algorithms in last four months. I only shared 5 of them on Leetcode discuss. I like to review 26 solved easy level algorithms very often, the best way to review them is to go through the Leetcode discuss link, so I can easily navigate to other posts.

It is time for me to share those 26 solved algorithms first. If I need to make the code better, I certainly can quickly update and then share on Leetcode discuss.

This is one of drills I like to do to help me improve my C# programming skills.


Medium level tree algorithms

Oct. 4, 2018

Introduction


I plan to work on medium level tree algorithms in next few weeks. I solved 14 medium level ones, and there are 24 ones for me to solve. What I like to do is to review the procedure I practice algorithm, I like to get organized, make sure that the code is ready to share on Leetcode discuss. I like to see some test cases with the submission.

The medium level tree algorithms can be accessed by the link here. Choose to click difficulty and then algorithms will be sorted by hard, medium and easy by level.


First thing to share solved algorithms


I spent half hour to share the submissions for those 14 solved medium level tree algorithms. It is not pleasant to read some code and then I could not tell what I learned from the practice. Mistakes, or concerns are missing in those submissions.