You are viewing a single comment's thread. Return to all comments →
python solution with O(1).
O(1)
import math def squares(a, b): #pow(a, 0.5) ~ pow(b, 0.5) start = math.ceil(pow(a, 0.5)) end = math.floor(pow(b, 0.5)) return end-start+1
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 →
python solution with
O(1)
.