Friday, August 18, 2017

Leetcode 532 - K-diff Pairs in an array

August 18, 2017

Introduction



It is the challenging task to complete the algorithm in 30 minutes, without a bug. I had a mocking experience 6:00 pm with a peer who is a master graduate student. The peer worked on a hard level algorithm, and I worked on easy level algorithm similar to Leetcode 532. Here is my C# practice with a bug.

Whiteboard testing 


Plan to look into the edge case. It is easy to fix the bug, here is the C# code with a bug fix.

I like to figure out how to make my white boarding testing more efficient.

Pay attention to white boarding testing, make sure that test cases are listed and also I do my best to examine the possible mistakes before I run test cases.

Follow up 



August 29, 2017
The C# code in practice has a few issues, and the code was updated with a few changes in order to pass all test cases. The code is here.

Algorithm Practice 



I practiced the Leetcode 532 and failed a few test cases. Need to go over discussion section and then search for great discussion.




No comments:

Post a Comment