Thursday, April 5, 2018

Being interviewer: Leetcode 250: Count univalue subtrees

April 5, 2018

Introduction


It is my favorite algorithm in March, 2018. I had two practices on this algorithm, one is to write the algorithm in 30 minutes mock interview, and the second one is to review the peer's practice. I chose the algorithm to interview the peer on April 4, 2018 10:00 PM, but I could not give out the solution based on the peer's code.

Follow up 


Here is the code I reviewed in mock interview. The peer asked my advice, but I could not tell at that time the code was bug free.

Now it is 9:20 PM April 5, 2018, I like to write a C# solution based on the simple idea, using negative to represent that the tree does not have same value. Here is my C# code.


No comments:

Post a Comment