Tuesday, September 4, 2018

Prepare for those easy level math algorithms

Sept. 4, 2018

Introduction


It is 11:48 PM. I like to work on those 25 math easy level algorithms. I like to memorize the algorithms before I work on those algorithms as well.

I like to design a drill for me to get comfortable to solve algorithms every day.

25 easy level math algorithms


Here is the snapshot I got from Leetcode.com

#TitleAcceptanceDifficultyFrequency
728 67.0%Easy
883 66.4%Easy
868 59.8%Easy
892 55.0%Easy
800 54.9%Easy
812 53.8%Easy
258 52.5%Easy
171 49.6%Easy
13 49.4%Easy
453 48.3%Easy
598 47.9%Easy
268 46.0%Easy
628 44.8%Easy
836 43.3%Easy
202 42.6%Easy
415 42.0%Easy
231 41.1%Easy
326 41.0%Easy
246 40.7%Easy
263 40.0%Easy
66 40.0%Easy
645 39.8%Easy
367 38.8%Easy
9 38.1%Easy
172 37.0%Easy
441 36.7%Easy
67 35.5%Easy
507 32.7%Easy
633 32.4%Easy
400 29.9%Easy
69 29.5%Easy
168 27.9%Easy
204 27.0%Easy
7 24.4%Easy

Follow up

Sept. 22, 2018
I spent time to go over blogs related to keyword search: solve easy level algorithms, and I found the blog that I started to prepare to work on 50 easy level algorithm August 14, 2018. 

From August 14 to Sept 4, 2018, I solved 50 easy level array algorithms. 

Get my confidence back

Sept. 4, 2018

Introduction


It is interesting to learn that soft skill most important one is confidence. I need to get my confidence back. In order to do that, I have to get some training on algorithm and data structure. I like to write more code in next one month.

It is not easy for me to calm down and get to start to code on easy level algorithms. There are so many things I like to do but I slowly learn that there are so much fun to write some code first, and then stay in Leetcode discuss community. There are enough fun for me to play.


Three things I like to analyze


Submission last years, solved algorithm, recent submission of algorithms. Those are three things I like to look into. I like to analyze the data and then figure out how soon I will play like those players.

I always like to check the profile with over one thousand submissions last year. Those are hard work people and they know what they want.




Invent and simplify

Sept. 4, 2018

Introduction


It is the first day after labor day long weekend, I came back to work. I was so busy today, and I spent over one hour to clean up my backup of database files.

I like to talk about "Invent and simplify" leadership principle.

Get organized


It is important to get organized. I started to use github for the source control at work from August 2017, ransom virus attack. But I notice that I need to spend some time to remove unnecessary backup database files today.


25 easy level math algorithms on Leetcode.com

Sept. 4, 2018

Introduction


It is 11:12 PM, Sept. 4, 2018. I like to document my journey to work on easy level math algorithm on Leetcode.com. There are 34 algorithms, with 9 solved, I plan to work on 25 algorithms starting from today.

Here is the link to get math easy level Leetcode algorithms.

Say goodbye to Leetcode array easy level algorithm

Sept. 4, 2018

Introduction


It is so good experience to work on easy level array algorithms, last few weeks I finished over 30 easy level array algorithsm. The feeling is like travelling to a nice place, so relax and I also learn from so many people through their sharing. It is really nice a community for me to work and learn easy level array algorithms.

It is like a vacation


I like to use one sentence to document my feeling, it is like a free vacation. I do not need to spend money, but I have good time and meet so many hard working people who share their experience for me.

Every algorithm there is a role model, with surprising solved algorithm over 1000 submission in the last year.

I learn to work hard, get more submissions first.

I do not like to spend time on surfing the internet any more. I am a responsible programmer who is training hard on basics.


Leetcode 840. Magic Squares In Grid

Sept. 4, 2018

Introduction


It is an easy level array algorithm. I submitted a few times. I did learn the lesson to read the statement carefully, I only checked two diagonal sum in my first writing.

My practice


Here is the discuss link I shared.

I read one of discuss and get encouraged to work hard on Leetcode.com. Here is the link. The submission of the last year is over 1300. Here is the leetcode profile.


Get smarter and get more productive

Sept. 4, 2018

Introduction


It is interesting to read the post written by Richard. Here is the link.

Think about two statements


If Google has to boil their interviews down to one question, it would be "how smart are you?".

If Amazon did the same, it would be "how productive are you?"

Both value many other things as well, but that's the core of each.


Celebrate 100 easy level algorithm on Leetcode.com

Sept. 4, 2018

Introduction


It is time for me to celebrate 100 easy level algorithms on Leetcode.com. Now it is 12:31 AM. I just need to start the blog and I will write something here.

The 100th easy level algorithm 


I spent over 30 minutes to work on 100th easy level algorithm. It is documented here.


Leetcode 867. Transpose matrix - pass 29/36 test cases

Sept. 4, 2018

Introduction


It is time for me to look into the analysis of the algorithm. The mindset to simplify the problem is so important in the algorithm called transpose matrix. I did submit 5 times, but the code only 29/36 test cases.

I played against the online judge, and ran into a few times with bugs.

My solution is time consuming but also not correct. The failed test case:
input:  [[1, 2, 3], [4, 5, 6]]
output: [[1, 4], [2, 5], [0, ]]
Expected: [[1, 4], [2, 5], [3, 6]]

My practice


Here is my code. I like to document my practice, remind myself to think carefully before I start to write the code.



Monday, September 3, 2018

Less is more

Sept. 3, 2018

Introduction


It is a long weekend. I went to church for Sunday service and the pastor gave a sermon about Less is more, more is less. Trust God, love God, and rest in the God.

The teaching is very efficient, since Vancouver is second expensive city in terms of housing in Canada. There is a lot of anxiety for people to find a housing in the city of Vancouver area.

Sometimes church's teaching is the mirror of current society. We do have to learn from the teaching.

Less is more

Less is more. I spent the long weekend to clean up my room. And I need to get organized and remind myself to think about space.

It is so important for us to have spaces in our office, home office, and living room. Every time I go out shopping and I will remind myself that I do not have space for extra clothing or stuff.




Celebrate of 277 submissions on Leetcode in the last year

Sept. 3, 2018

Introduction


It is 10:21 PM, and I like to write a small research talk. It is called to celebrate 277 submissions. I had 277 submission in the last year on Leetcode.com, I found one role model with 1300 submission in the last year.

Let us visualize the data


Here is my profile up to Sept. 3, 2018.


I know that it took me a lot of hours to finish 277 submissions. I did most of work last two months. 

Here is my role model, the profile is here. Ranking is 2086. Solved algorithm: 570/893


Actionable items


I have good time to work on easy level array algorithm on Leetcode.com today, but I also learn a few things through the study. 

I worked on easy level algorithm. One algorithm usually takes one submission. But tianyuan worked on medium level or hard level, one hard level algorithm took 4 submissions, one medium level took 7 submissions. 

So I will expect more submission after I finish another 120 easy level algorithms first. 

I miss the joy to work on medium level and hard level algorithms. I know that it is better for me to work on easy level algorithms, and get used to write code every day first. 

Here is the snapshot with a person over 570 solved problems, how the training looks like. 



  





766. Toeplitz Matrix

Sept. 3, 2018

Introduction


It is an easy level array algorithm. I wrote my first practice and then it passed the online judge. I checked the discuss, and then there is a solution with 4 lines of code.

My practice


Here is the code I shared on Leetcode.com.


Actionable Item


It is so easy to find a new role model to work hard on easy level algorithms. I found one profile yuantian, the link is here. She dis over 1300 submission starting from this January, 2018. It is a lot of hard work.

I am not sure LinkedIn profile, but I do believe that it is important for me to learn from her. Work on more leetcode algorithms, specially do not skip easy level algorithms.

One of Tian Yuan is here. Another one is here.

I just could not believe that it is so enjoyable to work on the easy level algorithm since people share their experience.


566. Reshape the Matrix

Sept. 3, 2018

Introduction


It is an easy level array algorithm. I did try to submit five times until the code passed the online judge. It is such a friendly remind for me to warm up basic algebra to map a node in original matrix to the new matrix.

My practice


Here is the link of my Leetcode discussion.


832. Flipping an Image

Sept. 3, 2018

Introduction


It is an easy level algorithm. I wrote the solution and also shared on Leetcode discuss.

Here is the link.


Sunday, September 2, 2018

I like to write on medium.com

Sept. 2, 2018

Introduction


It is the tough journey to write on medium.com. I have to find ways to get my first clap. I deleted one old post, and then wrote my first post based on my blog written in last Saturday.

Here is the post. I like to learn how to get my first clap.




896. Monotonic Array

Sept. 2, 2018

Introduction


It is an easy level algorithm. I worked on the algorithm and then I figured out that my analysis was not correct, I failed the test case [11,11, 9,4,3,3,3,1,-1,-1,3,3,5,5,5]. And then I got the idea to write the following code.

My practice


Here is my C# code shared on Leetcode discuss.


888. Fair Candy Swap

Sept. 2, 2018

Introduction


It is an easy level array algorithm. I like the algorithm since it is good training. I made two mistakes and then I figured out things by online judge. One is diff/ 2, not diff, and then second one is to keep the original order, if(sumA > sumB) enclosed block, I need to define the order of integer order to reverse the order.


My practice


Here is the link on Leetcode discuss I shared.


485. Max Consecutive Ones

Sept. 2, 2018

Introduction


It is an easy level array algorithm. It is my favorite practice as well.

My practice


Here is my C# code I shared on Leetcode discuss.


Celebration of 180 mark - I solved 180 Leetcode algorithms

Sept. 2, 2018

Introduction


It is so much joy for me to write easy level algorithms. I like to make it my hobby to write some algorithms and enjoy the workout time.

As a software programmer, I never know that it is so hard to build a good habit to write code every day. I like to be a competitive programmer, maybe, one of the best in the world.


180 mark 



I do not know how to approach so many Leetcode algorithms. Once my ex-coach told me to start to work on easy level algorithms, I just cannot stop. Here is one of talk we had on August 5, 2018.

Life is so good, every time I work on easy level algorithm, I know that I am preparing for more important project, and also I am training myself to be a good thinker and very good responsible person.

Whatever the company I am working for, I should be able to feel so comfortable to take the project, and focus on more customers, work with project management stuff. So excited to get 180 mark.

I wrote a blog to celebrate 150 mark on August 14, 2018, more than two weeks ago. Here is the blog.


Let us visualize the data 


Here is July 21, 2018:

Detail please refer to this blog written in July, 2018. Here is the link. 

Here is Sept. 2, 2018:

Here is my Leetcode profile.

I solved 62 easy level algorithm from July 21 to Sept 2, 2018. So much joy to work on those seventy algorithms. I never experience so much joy, once I focus on coding, I just forget everything. I know that if I am very good at doing algorithm and data structure problem solving, all I need is to be myself, and present myself very well.



695. Max Area of Island

Sept. 2, 2018

Introduction


It is an easy level array algorithm. I chose to use recursive function to visit all the nodes in the same island and also count the number of elements.

My practice


Here is the link of Leetcode discussion post I shared.


7 submissions to 35 submission a day on Leetcode.com

Sept. 2, 2018

Introduction


It is 12:32 AM, I like to do a simple study before I go to bed. What it takes from 7 submissions to 35 submission a day on Leetcode.com.

I did submit 7 times a day and then I exhausted and needed to take some break to work on other task. But I studied one person submitted 35 times in one day, and he completed over 840 algorithms, ranking 70 out of 100,000 people.

My research is how to advance myself to submit 35 times in one day. I chose to work on array easy level algorithms, so I can submit 7 times a day. My Leetcode ranking is 50000, how can I advance myself from ranking 50000 to ranking 70. I do not think that it is possible. There are over 200 medium level algorithm, and over 100 hard level algorithm.

Invent and simplify


I like to invent a drill for myself. One thing I can think about is to submit more than 10 algorithms a day three times, try to figure out how to do that.




Saturday, September 1, 2018

US Open 2018 Maria Sharapova interview after match vs Jelena Ostapenko

Sept 12, 2018

Introduction


It is best time for me to relax and spent 9 minutes to watch the interview of Sharapova. Every time I need some coaching, I always go to watch Sharapova's interview. Here is the interview link.


Leverage 5 of 14 Amazon leadership principles

Sept. 1, 2018

Introduction

It is 11:26 PM. I took a break after more than 60 minutes coding, I submitted 6 times with 4 algorithms. I really like to take a break to study Amazon leadership principles.

Here is the article I like to read.

7 soft skills help you succeed in the workplace

Sept. 1, 2018

Introduction


It is the article shared by a young software engineer who works for Amazon. Here is the article link.

7 soft skills


1. Confidence is one of the most important soft skills
2. But don't forget to be humble, either
3. Remember to always listen
4. Understand the big picture
5. Get involved in company groups - they might just help your career, too
6. It's not enough to know complicated technical concepts - you'll need to explain them to others, too
7. Learn how to document your progress

My case number IMM-878-09

Sept. 1, 2018

Introduction


It is very valuable life experience to file an appeal case in Canadian Federal court. I have one back in 2009 and the case number is IMM-878-09.

I have chance to review the paper work I did in 2009 to file Canada immigration appeal case. I spent some time to read through my gmail correspondences with different people, Canada department of justice lawyer, immigration consultant, registry officers. I spent so many hours to work on my own immigration case back in 2009. I really like to write a blog related to my immigration appeal case.

Another blog is so helpful


I like to copy some content from my previous blog. The blog's link is here.

A smart programmer learns to write great code, but she likes to learn basics as well. Like cooking at home, and sports. She likes to learn to write down her lessons one a time, she likes to break a vicious cycle starting from 17 years ago.

Back to 1999, she only has 2 miles to drive to work, she bought a brand new car, sports utilities vehicle, even though Florida is such a flat terrain area to drive, and it is on the credit, a factory loan from Ford company. And she bought a 3 years Bally gym contract, she only showed up less than 20 times in 3 years. One time she got 20 dollars class inside the gym.

Back to 2008, She did take three time IELTS tests in 2008 in order to meet Canada immigration minimum score. She did 3 times in a row in 3 months time range and she achieved her goal. And six month later she got denial application result, then she started to appeal case over 10 months from January to October 2009, she did almost flunk her appeal against Canadian Federal court even though she did everything by herself, but she won the judge approval for a court date in June 2009.

Back to 2009, Julia got an offer to pay 1000 dollars and the immigration lawyer will write a letter for her to the immigration department to appeal her denial of decision in January 2009. Julia decided to write a letter by herself, and filed an appeal case by herself in 60 days after the denial. She worked on the appeal for leave more than 10 months, and got settle offer in Sept. 2009. It is a miracle that Julia did not go to the court and settle down outside the court. The statistics shows that 90% of case settles outside the court.

Through the immigration lawsuit, Julia knew how important it is to work with people very carefully, and gain the trust and support from the people. First time she understood that how important a judge can make a difference in her life. The Canadian immigration judge gave her a chance to go to the court even though she just learned to file the lawsuit document by herself, she studied over 20 immigration lawyers website, case studies. She tried to write down notes to help her to find laws, facts, where are the good arguments. It was so much fun to work on her own case through those months, she learned the first time she had to write document each step, and stayed focus on each step.

She understood that it is most important thing in the life called immigration, and it is very important to study every detail by herself even if she decides to ask the help from the full time consultant.

In 2007, Julia chose to work for herself instead of using licensed immigration consultant for sponsor application.

Best teacher is to learn your own mistake, experience failures, she likes to get the application file again as soon as possible. And also she likes to write down her process, so she can overcome her procrastination problem, learn how to get into the zone of filing, and preparing process.

Julia wrote a blog on July 1 Canada day, and then shifted her focus on the sponsor application instead of Hackerrank contests, and Leetcode algorithms, and mocking interviews after work and weekends. Being a responsible person, make a plan, and follow through the plan. That makes a person success, it does not matter if the project is algorithm and data structure practice, or other thing like sponsor application.

Learn frugality leadership principle

Sept. 1, 2018

Introduction


It is my short research topic today since it is a long weekend, Canada labor long weekend. It is called learn frugality leadership principle.

I had the full time position as a software engineer from 1998 December to 2000 September in Florida USA. I like to write down financial lessons I learned.

I like to write down some stories in year 2000 and 2001, and how I learn from my own experience. The frugality leadership principle can change a person's life.

From USA to Canada 


I immigrated from United States to Canada as a Chinese citizen. I spent 14 years in United States from August 1996 to April 2010.

Take some calculated risk.

I have to work  hard in Canada in order to settle down, after more than eight years in Canada, I learn that I have to continuously work hard, and also need to catch up on personal finance research.


My mistakes of purchase decisions 


I like to write a series of purchases I made through year 2000 to 2001, and I could not believe that I was the person who does not think about frugality and believe that frugality can breed resourcefulness, self-sufficiency and invention.

Back to 1999 in United States, the home loan's interest is 7.125% when I purchased my first home in Florida. After I purchased the first home in Florida with less than $10,000 down payment. I made my only purchase home from 1999 to 2018. I just could not believe that I did the purchase.

But after that, I just made a series of mistakes in purchase decisions.

In 1999, I purchased a car with Ford credit 0.9% interest, brand new car over $18,000 dollars with less than $3000 dollar down payment. 

In 2000, just after the purchase the home, I bought leather sofa $2000 dollars with one year zero interest loan in 2000.

In 2000, I chose not to rent out the extra bedroom over a year, the normal rent fee is around $300 us dollar in the year of 2000. I paid loan interest every year 7.125% interest rate over $25,000 us dollar loan. Every month the interest is around $200 us dollars.

In 2000, I spent over $5000 us dollar for a trip to China to visit my mom. It is almost the price of a home with 500 square foot in the city of Yichun, the price at that time is less than 600 RMB/square meters. 

In 2001, I bought a laptop over $1500 dollars zero interest finance for a year from bestbuy.com.

I list so many purchases without careful consideration of consequences, I really like to learn from my mistakes.

To live healthy and happy, I do not not need so many material stuff, expensive international trip.

Being naive and young, I wasted all those money and resource, I like to write down and share with young generation who likes to pursuit software programmer careers. The better you are in finance situation, less stress, you will be better to handle your career, more freedom to pursuit your goal. 

It is time for me to study Amazon leadership principle Frugality again.

Frugality

Accomplish more with less. Constraints breed resourcefulness, self-sufficiency and invention. There are no extra points for growing headcount, budget size or fixed expense.

Leetcode 687. Longest univalue path

Sept. 1, 2018

Introduction


It is an easy level tree algorithm. I choose the algorithm to interview over five people last month on interviewing.io. On Sept. 30, 2018 10:00 PM, I had chance to work with the interviewee over 45 minutes again on the algorithm.

As an interviewer, I also learn the algorithm through the mock interview. I like to write another solution based on the discussion with a few interviewees last 30 days.


My practice


I like to write another idea to solve the problem. I started to write the blog 11:07 AM, now it is 12:04 PM, it took me 63 minutes to complete the following task:

1. Write the C# code and submit it against Leetcode online judge. The code passes all test cases.
2. Write a post on leetcode.com, here is the link.

I need to save it on my github as well. I will spend 20 minutes to write a post on code review website and get some review in the future.


How to set a good target for your professional growth?

Sept. 1, 2018

Introduction


It is a long weekend in Canada and I like to relax and write a simple and easy blog to share with others. The title is called how to set a good target for your professional growth.

My target is to finish 70 easy level algorithm every month, or 50 medium level or 30 difficult level algorithm on Leetcode.com. I like to finish easy level algorithms first, and then move to medium level. I believe that I should get enough basic training first, and then move on tricky ones. Take it easy and learn very well on those easy level algorithms. They are best friends of programmers.

Why do I set the target?

I set the target based on data, analysis, and also my past experience.

Below 50% average


I like to show the report on interviewing.io I had early this year, 3 interviews as an interviewee. 


I think that it is impossible for a Chinese to perform super good on interview if she has not practiced over 300 algorithms on Leetcode.com.

I think that the evaluation is not biased. Since it matches my performance on Leetcode.com.

Ranking 50000


I did quick study about my Leetcode ranking, I wrote a blog on this. My ranking is around 50000 on Leetcode.com based on my solved algorithm 177/889 up to Sept. 1, 2018.

In order for me to set an ambitious target to stay competitive on job market, I have to work on this ranking first.

My target is to finish all easy level algorithms left on Leetcode.com, in total around 150 algorithms. This is a smart approach, I can quickly build up some good experience and also good habit to write code daily.

Based on this August performance, I finished 34 easy level algorithms, I certainly can keep the same pace, two easy level algorithms a day. Here is the detail in my blog to document my practice.

My target is to move my ranking to 10000 first.


Community builder


It takes a village to raise a child.

The culture is so important for me to work for. I like to journal my practice, and get help and encouragement from others. I need to reach the community and find role models.

It is my good choice. Share my practice on Leetcode discuss for every algorithm I practice. Share more on code review stackexchange.com based on my Leetcode.com practice.

What is my target?


Hackerrank


Here is my hackerrank profile. I have not set any target for my practice on Hackerrank.com. Compared to Leetcode.com, I like to focus on Leetcode.com first, also focus on easy level algorithms first. As long as I continue to work on coding on daily basis, I will figure out ways to improve my performance.


Leetcode submission last 12 months


I like to set a target to make over 1600 submission for next 12 months.

To build a habit to write code every day, it is not easy task. I have not done this last eight years. Now I start to build a habit on this.

Here is my last 12 months submission.



Here is my target future 12 months submission. I find a role model for me to follow.



I like to set my submission target.

Here are some data for me to look into:

Less than 8
Between 8 - 17
Between 17 - 25
Between 25 - 34
More than 34

The role model did have submission more than 20 a day Sept, 2017 two times, 35 submission - Sept. 17, 23 submission - Sept. 19, 2018

Based on my experience, I felt so exhausted after I submitted more than 9 times on one day.

9 submissions a day, here is the algorithms I worked on, array easy level algorithms.


I need to work on endurance training. How to stay focus on after 9 submissions? One tip is to avoid complicated code, change the design to remove unnecessary user cases, cut to minimum of user cases.

I documented my struggle through the blog related to algorithm Leetcode 448. The lesson I learned is to avoid complicated code, or design, or introduction of extra use cases to complicate the solution. -1 as element of the array really exhausted me through over 20 minutes struggle. I decided to give up after 20 minutes.

Friday, August 31, 2018

What is the best target for a software programmer?

August 31, 2018

Introduction


It is 8:54 PM Friday evening, I like to write a blog related to my research "What is the best target for a software programmer to set a training target?". Today I found a Google programmer who completed 837 algorithms, 1661 submission in the last year. I ask myself what if I set a target for myself, next 12 months, what is number I can reach?

I have worked on Leetcode.com over three years starting from 2015 January, but I only solved 177 algorithms, but last 77 algorithms are solved in less than 3 months.

Target, motivation, and learning ability 


I like to improve my learning ability, set a good target on Leetcode.com algorithms.

Let us read some data.

The person is ranking 70 on Leetcode.com. My ranking is 50931. My ex-coach's ranking is 3000, solved algorithm 525/ 889.


I like to use this ranking metrics as my target. I like to document how hard it is to move ranking up to 40000, 30000, 20000, 10000, 5000. 

New metrics


The ranking is my target. I like to see if I solve another 120 easy algorithms in next one or two months, with 300 solved algorithms, what will be my ranking. I like to choose to work on another 120 easy level algorithm. Since it is easy to work on, and I need to get more experience to solve the problems first. 



All profiles are from the discussion panel here

I just quickly use this profile to look into with solved 300 algorithm, the ranking will be 15937. Here is the profile. Here is linkedin profile. I just could not believe that the engineer is a Facebook engineer.

Ranking 15618, solved 327 algorithms, 47 contests, here is profile of Citrix software engineer.
Ranking 16619, solved 319 algorithms, here is profile.
Ranking 23050, solved 277 algorithms, here is the profile.

My target - find 300 algorithm to solve 


It is not easy for me to work on algorithms. Some of us can finish 300 medium algorithm in 3 months. Some of us can finish 180 algorithms in 3 months.

I know that it takes a lot of work to focus on the algorithm practice. I have to focus on coding, cut down the hours to do other activities.

And also I need to be very smart, also focus on the algorithm, pass online judge. Do not think about algorithms too long. It does not help too much to reach target.

It is good practice to start from easy level algorithm, solve 150 easy level algorithm, and then move on medium level algorithms.

I have to be careful not to waste time. Pay attention to any project longer than three hours. Most important is to get used to solve algorithm problems. I need to get myself comfortable and also try to figure out the ways to expedite the coding.

It is good to try various solutions for one algorithm. But in order to expedite the process, it is better to move on new algorithm, save time for the new algorithm.



I have fight good fight, I have finished the race, I have kept the faith. Timothy 4:7-8
My favorite verse is here



Thursday, August 30, 2018

Leetcode 448. Find All Numbers Disappeared in an Array



Here is my Leetcode discuss link.

Leetcode 448. Find All Numbers Disappeared in an Array - My struggle

August 30, 2018

Introduction


I have to figure out how to complete my broken solution afterwards. I found the optimal solution by reading one of discuss, I wrote the similar one. But I like to continue to write the one much complicated, and then I need to figure out how to make it work as well.

My idea is too complicated and I could not come out the solution. My design is like the following.

[3, 1, 2],
Line 1:  First, index = 0, value 3, so 3 should be put at index = 2,
         2: Next, index = 0, put -1,
         3: Next, index = 2, value 2 is save as a variable
         4: Next, index = 2, put 3,
         5: Next, work on value 2, put its position to index = 1 if need.
I introduce negative one value as the array's temporary value, the change brings into so many user cases. It affects line 5, line 1. The value has to be checked first, since now there is an empty element concept now.

The lesson learned is that I have to evaluate all options first, it is better to choose easy and short solution to write. Evaluate user cases before I write code for the solution.

My practice 


I found out that I could not make the code working, since there are so many cases to handle related to -1 value.

I chose to use extra space to save some elements in the array. And I wrote C# code to pass the test cases. Here is my C# practice.


Leetcode 169. Majority element

August 30, 2018

Introduction


It is an easy level array algorithm. I wrote the solution based on the idea to iterate the array from left to right once, and majority element will keep change, but last one will be the majority element.

My practice


Here is my sharing on Leetcode discuss.


Leetcode 717. 1-bit and 2-bit characters

August 30, 2018

Introduction


It is an easy level algorithm using dynamic programming solution. I stumbled on the solution a few times, I had to fix bugs three times in order to pass online judge.

The algorithm is my favorite one now. I know that the algorithm practice is also good training for me. Sometimes I notice that I need more training to understand the statement "the last character must be a one-bit character". I failed a few times since I did not memorize the requirement, I confused that the expression is valid to express the number.

My practice


I like to write something to share my practice. Here is Leetcode discuss link.


Leetcode 746: Min cost climbing stairs

August 30, 2018

Introduction


It is an easy level algorithm and I wrote a solution using dynamic programming.

My practice


I need to write a few sentences to summarize my approach and then share the code. Here is my sharing on Leetcode discuss.

Case study: Google interview algorithm

August 30, 2018

Introduction


I came cross this post with more 30,000 views. Here is the link. It is a good break for me to read something related to onsite interview algorithm.


Google search keyword: leetcode jianmin.chen.39

August 30, 2018

Introduction


For some reason Leetcode.com removed the feature to list all sharing for each user. I wondered what I should do, then I came cross this Google search result page, using keyword: Leetcode jianmin.chen.39, I can easily track how many sharings I have posted so far. Here is the link of search result.

I like to track how many sharing I have posted, and I like to get more active in Leetcode.com community. That will be the best place I learn and share next few months.

15 algorithm discuss sharing


I can easily find first two pages with around 15 algorithms I wrote something for sharing. I have posted more than 15 times, I like to figure out how to find them.


Medium.com claps product feature

August 30, 2018

Introduction


It is small surprise that I can read my claps on medium.com. Here is the link. I like the claps feature, it really helps me to stay organized, I can easily review those articles I chose to clap.




Wednesday, August 29, 2018

Easy level algorithms - 2 easy level algorithm a day for 17 days

August 28, 2018

Introduction


Starting from July 10, I started to work on easy level algorithms on Leetcode.com. Here is my status on Leetcode.com, 179/889 solved, easy 91, medium 63, hard 33. I also created a folder for easy level algorithms on github, here is the link.

August 13, 2018
August 30, 2018


Google search


I just find out that Google search does good job, when I search "jianmin chen leetcode", all sharings of my practice are listed. Here is the link for search result. 


2 easy level algorithms a day 



It is slow in the average, 2 easy level algorithms a day, from August 13 to August 30, I finished 34 easy level algorithms. I like to learn how I can work on easy level algorithm in one hour, I can finish 3 algorithms without any headache, nervousness, and bugs catched by Leetcode online judge.

To be a professional software programmer, it is so important for me to learn that training is so important, and also very serious part to continue to make a living as a software programmer.

I think that using easy level algorithm to train myself is necessary and I understand that it is also very important for me to ensure that I can keep myself think hard and work hard on crafting skills.

There is difference with two people, one training every day, one does not train at all in the sports. Same as a software programmer, one month ago I will show up so nervous, since I do not get enough training daily, continuously over years from 2000 to 2018.


Leetcode 674

Leetcode 27

Leetcode 118