You are viewing a single comment's thread. Return to all comments →
**Java **
public static int squares(int a, int b) { int res = 0; for (int i = (int) Math.sqrt(b); i >= Math.sqrt(a); i--) { if (i * i >= a && i * i <= b) { res++; } } return res; }
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 →
**Java **