Skip to content

raulgonzalezcz/tarea2

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 

Repository files navigation

Tarea 2

HackerRank Modified Challenge Sherlock and Squares

Problem Statement

Watson gives two integers (A and B) to Sherlock and asks if he can count the number of square integers between A and B (both inclusive).

Note: A square integer is an integer which is the square of any integer. For example, 1, 4, 9, and 16 are some of the square integers as they are squares of 1, 2, 3, and 4, respectively.

The program must be written on the file sherlock.js which has the initial input.

Input Format

The cases are stored inside the variable _INPUT

The first line contains T, the number of test cases. T test cases follow, each in a new line. Each test case contains two space-separated integers denoting A and B.

Output Format

For each test case, print the required answer in a new line.

Constraints

1≤T≤100

1≤A≤B≤10^9

Sample Input

2
3 9
17 24

Sample output

2
0

Explanation

Test Case #00: In range [3,9], 4 and 9 are the two square numbers.

Test Case #01: In range [17,24], there are no square numbers.

Programming language

// JavaScript

Author

Raúl González Cruz

Computer Systems Engineering, UDLAP

About

Repositorio para la tarea 2: Solución a un problema de HackerRank

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%