leetcode: https://leetcode.com/problems/sqrtx/
Problem:
Given a non-negative integer x, compute and return the square root of x.
x
Since the return type is an integer, the decimal digits are truncated, and only the…