Tuesday, November 21, 2017

Leetcode 69. Sqrt(x)

Nov. 21, 2017


Introduction


It is the algorithm to apply binary search and also relate to math round of a number given the error range, the algorithm is similar to easy level algorithm called Leetcode 69, Sqrt(x).


Algorithm review 


Julia spent first 30 minutes to work on the algorithm analysis and wrote code. Afterwards, the peer helped Julia to find bugs to make sure all test cases are passed.

Here is C# code submission with bugs.

Here is C# code submission after discussion of issues causing bugs. The code passes all test cases.


Highlights of discussion


It took almost three hours for Julia to discuss with the peer how to solve the algorithm and data structure problems. The mock interview had some technical issue, so the additional tools are used. One is for vidoe, https://appear.in and the other one is for editing, http://collabedit.com/. The mock interview started from 10:05 PM and ended around 1:15 am next morning.







No comments:

Post a Comment