Showing posts with label algorithm training should involve online judge. Show all posts
Showing posts with label algorithm training should involve online judge. Show all posts

Sunday, July 29, 2018

Leetcode 337: House robber III

July 29, 2018

Introduction


It is the medium level tree algorithm called House robber III. My learning experience covers a few areas. I chose to listen video lecture, and also I read some blogs related to the algorithm, one of blogs I read is served by grandyang.

I spent time to work on the video served by basketwangcoding, and I like to get some help from his lectures.

Plan to write C# code for House robber III.

My practice


Here is my C# code which is verified by Leetcode online judge.


New attitude


I understand that it is very important for me to submit as many algorithms as possible on Leetcode. So I slowed down everything and wrote a solution after I spent over 30 minutes to learn from video teaching from a Facebook engineer and also blog reading.

Algorithm training should be a science, I should understand the idea how to solve the problem first, and then also need to 100% follow the idea by applying my code against online judge.

What is science?


follow up on July 31, 2018
Do  not spend too much time to read the algorithm, once I understand the idea, I should move on the implementation. How quick I can write, how complete solution I can come out to cover the problem? How to find edge case, interesting subproblems through online judge.

I am training myself to be a good programmer.