add a solution for implementing int sqrt(int x).