Skip to main content

Posts

Showing posts with the label Day 25: Running Time and Complexity Hackerrank Solution Java

Day 25: Running Time and Complexity Hackerrank Solution Java

 Day 25: Running Time and Complexity  For Explanation Check Video: Sample Input 3 12 5 7 Sample Output Not prime Prime Prime Code: import  java.io.*; import  java.util.*; public   class  Solution {      public   static   void  main(String[] args) {         Scanner scn =  new  Scanner(System.in);          int  t = scn.nextInt();          while (t--> 0 ){              int  n = scn.nextInt();              if (n== 1  || n< 1 ){                 System.out.println( "Not prime" );         ...