@@ -0,0 +1,1362 @@
+package algorithms.implementation;%0D%0A%0D%0Aimport java.util.Scanner;%0D%0A%0D%0A/*%0D%0A * Problem Statement: %0D%0A * Watson gives two integers (A and B) to Sherlock and asks if he can count the%0D%0A * number of square integers between A and B (both inclusive).%0D%0A * %0D%0A * Note: A square integer is an integer which is the square of any integer. For%0D%0A * example, 1, 4, 9, and 16 are some of the square integers as they are squares%0D%0A * of 1, 2, 3, and 4, respectively.%0D%0A * %0D%0A * Input Format:%0D%0A * The first line contains T, the number of test cases. T test cases follow,%0D%0A * each in a new line.%0D%0A * Each test case contains two space-separated integers denoting A and B.%0D%0A * %0D%0A * Output Format:%0D%0A * For each test case, print the required answer in a new line.%0D%0A * %0D%0A * Constraints:%0D%0A * 1 %3C= T %3C= 100%0D%0A * 1 %3C= A %3C= B %3C= 10%5E9%0D%0A * %0D%0A * Sample Input: %0D%0A * 2%0D%0A * 3 9%0D%0A * 17 24%0D%0A * %0D%0A * Sample output: %0D%0A * 2%0D%0A * 0%0D%0A */%0D%0Apublic class SherlockAndSquares %7B%0D%0A%0D%0A%09public static void main(String%5B%5D args) %7B%0D%0A%09%09Scanner sc = new Scanner(System.in);%0D%0A%0D%0A%09    int numCases = sc.nextInt();%0D%0A%09  %0D%0A%09    for (int i = 0; i %3C numCases; i++) %7B%0D%0A%09    %09int begin = sc.nextInt();%0D%0A%09    %09int end = sc.nextInt();%0D%0A%09  %0D%0A%09    %09int smallest = (int)Math.ceil(Math.sqrt(begin));%0D%0A%09    %09int highest = (int)Math.floor(Math.sqrt(end));%0D%0A%09    %09%0D%0A%09    %09System.out.println(highest - smallest + 1);%0D%0A%09    %7D %0D%0A%09    sc.close();%0D%0A%09%7D%0D%0A%7D

Add SherlockAndSquares