Solved LeetCode program · 69 of 1,000
#0069 · Sqrt(x)
Original English source
The target is 8. The low is 0. The high is target. The answer is 0.
Repeat while low is at most high.
The middle is the midpoint of low and high. If middle times middle is at most target, set answer to middle, set low to one more than middle, otherwise set high to one less than middle.
Show answer.
Expected stdout
2