Codes/Volume 01/E0041 Pandigital prime.cpp
/*
Statement:
 We shall say that an n-digit number is pandigital if it makes use of all the digits 1 to n exactly once. For example, 2143 is a 4-digit 
 pandigital and is also prime.

 What is the largest n-digit pandigital prime that exists?
*/
We shall say that an n-digit number is pandigital if it makes use of all the digits 1 to n exactly once. For example, 2143 is a 4-digit
pandigital and is also prime.


We shall say that an n - digit number is pandigital if it makes use of all the digits 1 to n exactly once . For example 2143 is a 4 - digit pandigital and is also prime .
bool isPrime(ll number){
    if(number == 2) return true;
    if(number == 1 || number % 2 == 0) return false;
    for(ll divi = 3; divi*divi <= number; divi+=2){
        if(number % divi == 0) return false;
    }
    return true;
}
bool isPrime ( ll number ) { if ( number == 2 ) return true ; if ( number == 1 || number % 2 == 0 ) return false ; for ( ll divi = 3 ; divi * divi <= number ; divi += 2 ) { if ( number % divi == 0 ) return false ; } return true ; }
Statement:
We shall say that an n-digit number is pandigital if it makes use of all the digits 1 to n exactly once.
Statement : We shall say that an n - digit number is pandigital if it makes use of all the digits 1 to n exactly once .