You are viewing a single comment's thread. Return to all comments →
Used a similar formula, but I ended up with (using Java)
(int)Math.floor(Math.sqrt(B)) - (int)Math.floor(Math.sqrt(A-1))
It works on all the test cases, but I am wondering if this is mathematically the same thing. I rounded down on A instead.
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 →
Used a similar formula, but I ended up with (using Java)
(int)Math.floor(Math.sqrt(B)) - (int)Math.floor(Math.sqrt(A-1))
It works on all the test cases, but I am wondering if this is mathematically the same thing. I rounded down on A instead.