Skip to content

Latest commit

 

History

History

day-25-running-time-and-complexity

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

Day 25: Running Time and Complexity

https://www.hackerrank.com/challenges/30-running-time-and-complexity

Problem

Today we're learning about running time!

Task

A prime is a natural number greater than 1 that has no positive divisors other than 1 and itself. Given a number, n, determine and print whether it's Prime or Not Prime.

Input Format

The first line contains an integer, T, the number of test cases.
Each of the T subsequent lines contains an integer, n, to be tested for primality.

Output Format

For each test case, print whether n is Prime or Not Prime on a new line.

Sample Input

3
12
5
7

Sample Output

Not prime
Prime
Prime

My Solution