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

# Disappointed by the simplicity

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