Introduction
It is my most favorite algorithm in the world. I could not believe that I practiced today with an engineer in Oregon and also I did learn a few things through mock interview. I took extra 30 minutes to discuss with the peer about algorithm practice and exchange ideas. The peer recommended me to practice on codefights.com, consider the purchase of interviewcake.com algorithms with the answers.
I remembered that in 2015 I did study over 5 solution on Sudoku solver algorithm, I spent over 40 hours to practice the algorithm. At that time, I thought that I was the expert on the algorithm. It was so naive and here is the blog link for those practices.
Code practice
After I finished the code, I ran the test cases, I only passed one of test cases. So I found out that the hashset should be digits from 1 to 9 excluding those number showing in the same row or column or 3 x 3 small matrix. I just naively got those numbers and put into the hashset instead.
Here is the code. It took me exactly 30 minutes to pass all test cases. I spent around 5 minutes to fix all bugs.
No comments:
Post a Comment