LinkedIn Interview Question

sqrt of a number to the nearest integer.

Interview Answer

Anonymous

May 30, 2018

Start with the mid point as n/2 and determine to search for a new mid in left or right by comparing the square of the mid to the given the number. There's a tricky solution online by I would have to be a math major to decode that formula if I had written that two line code.