Disappointed by the simplicity


#1
  int i = 0;
    while(1)
    {
        if(pow(i,2)<=A&&pow(i+1,2)>A)
        return i;
        i++;
    }
    return -1;

#2

The point of the question was to implement it using binary search. Linear search should’ve given TLE.

If it passed, even then i suggest you to solve using binary search