Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void divide(int x,int dig[],bool check[],int &Max)
- {
- while (x>0)
- {
- int a=x%10;
- if (!check[a])
- {
- check[a]=true;
- dig[a]++;
- if (dig[a]>Max) Max=dig[a];
- }
- x/=10;
- }
- for (int i=0;i<10;i++)
- if (!check[i]) dig[i]=0;
- else check[i]=false;
- }
- int seq(int * tab,int n)
- {
- int Max=0;
- int dig[10]={};
- bool check[10]={};
- for (int i=0;i<n;i++)
- divide(tab[i],dig,check,Max);
- return Max;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement