Created
March 19, 2016 23:25
-
-
Save neonbadger/a22176b11f70fafc6d39 to your computer and use it in GitHub Desktop.
Hackerrank Solutions
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Hackerrank Solution for Sherlock & Squares | |
Print number of square integers between two numbers. | |
""" | |
import math | |
if __name__ == '__main__': | |
test_count = input() | |
for _ in xrange(test_count): | |
A, B = map(int, raw_input().split()) | |
a = int(math.ceil(math.sqrt(A))) | |
b = int(math.floor(math.sqrt(B))) | |
print b - a + 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment