Introduction
It is hard to get used to write bug-free code for dynamic programming. Specially base case handling.
Here is C# code I practiced on Dec. 16, 2017 10:00 AM. The code I wrote had a bug to handle the array with length 1, the product should be 0 instead of 1.
Feelings
First try to explain very clearly the idea, and then it is very easy to write the code just following the idea.
I have practiced this algorithm more than 4 times since March, 2017. I still made an error on edge case. I just added tags for all past practice using Leetcode 238: product of array except itself, so I can easy go over the past practices and review them.
Get organized
Source code is the key information to document how good/ not good I am in terms of algorithm analysis, coding style, and also whiteboard testing.
March 21, 2016, here is the blog about the practice.
Oct. 29, 2017, here is the blog about the practice.
Dec. 16, 2017 practice is Here.
No comments:
Post a Comment