You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
//DESCRIPTION: Note that 9-digit and 8-digit pandigital numbers will always be divisible by 3, and therefore cannot be prime. We only need to check 1-, 4-, and 7-digit numbers.
#include <iostream>
#include <fstream>
#include <string>
#include <algorithm>
using namespace std;
bool ipd47(int a)
{
string n = to_string(a);
sort(n.begin(), n.end());
if ((n.compare("1234") == 0) || (n.compare("1234567") == 0))