You are viewing a single comment's thread. Return to all comments →
Here is an inverse of the formula that may help someone understand why the square root formula works:
int squares(int a, int b) { int numOfSquares = 0; int x = 1; while(x*x < a)x++; while(x*x <= b){ numOfSquares++; x++; } return numOfSquares; }
Seems like cookies are disabled on this browser, please enable them to open this website
Sherlock and Squares
You are viewing a single comment's thread. Return to all comments →
Here is an inverse of the formula that may help someone understand why the square root formula works: