Function to check that a number is a prime or not in O ( sqrt ( N ) )
bool isPrime ( int N ) { if ( N < 2 ) return false ; if ( N < 4 ) return true ; if ( ( N & 1 ) == 0 ) return false ; if ( N % 3 == 0 ) return false ; int curr = 5 , s = sqrt ( N ) ;