Skip to content

Instantly share code, notes, and snippets.

@neonbadger
Created March 19, 2016 23:25
Show Gist options
  • Save neonbadger/a22176b11f70fafc6d39 to your computer and use it in GitHub Desktop.
Save neonbadger/a22176b11f70fafc6d39 to your computer and use it in GitHub Desktop.
Hackerrank Solutions
"""
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