Saturday, January 13, 2018

Leetcode: Array of Array products

January 13, 2018

Introduction


It is the time for me to write Array of array products again. Last two practices, I made some mistakes. One time I made 3 mistakes in Dec. 2017, I documented in the blog. So this time I have to work on something to make it perfect. What I did is to count how many multiplication I have to allow me to consume in the design of dynamic programming method.

Code review

Here is C# code.

I wrote down the multiplication allowed in first iteration from left to right, I only allow myself to do n multiplication. However, second iteration from right to left, I have to do one more extra multiplication, take the existing product value to multiple rightToLeftProduct variable.

This time I did extra work to check how many multiplication operations are allowed in the design process, I write perfect code based on this extra checking.

After the mock interview, I asked the peer to solve extra algorithm related to DFS and dynamic programming method.

Actionable Items

January 14, 2018 11:33 PM

Julia, try to work on your analysis. Make your writing a better one. Think about production ready code. Also think about analysis of algorithm should be ready to publish as well.

Learn from the peer how he wrote his analysis algorithm. The blog is here.



No comments:

Post a Comment