package hackerrank.ctci;

import java.util.Scanner;

/**
 * https://www.hackerrank.com/challenges/ctci-big-o
 */
public class Primality {
    private static String isPrime(int n) {
        // TODO
        return "";
    }

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int p = in.nextInt();
        for (int a0 = 0; a0 < p; a0++) {
            int n = in.nextInt();
            System.out.println(isPrime(n));
        }
    }
}

@@ -186,15 +186,21 @@
     
-// TODO
+if (n == 1) %7B
 %0A   
@@ -208,16 +208,20 @@
     
+    
 return %22
 %22;%0A 
@@ -216,16 +216,270 @@
 return %22
+Not prime%22;%0A        %7D%0A        boolean prime = true;%0A        for (int i = 2; i %3C Math.sqrt(n); i++) %7B%0A            if (n %25 i == 0) %7B%0A                prime = false;%0A                break;%0A            %7D%0A        %7D%0A        return (prime) ? %22Prime%22 : %22Not prime
 %22;%0A    %7D

Solve Primality