Please some one tell me problem in my code


#1

int Solution::solve(vector &a, int b, int c) {
if(a.size()==0)
return 0;
map<int,bool> m;
int p=pow(10,b);
int mx=min(p,c);
for(int i=pow(10,b-1);i<mx;i++)
{
bool tg=true;
int n=i;
while(n!=0){
int r=n%10;
n/=10;
if(binary_search(a.begin(),a.end(),r)!=1){
tg=false;break;
}
}
if(tg==true)
m[i]=true;
else
m[i]=false;
}
int ans=0;
for(int i=pow(10,b-1);i<c;i++){
if(m[i]==true)
ans++;
}
if(b==1){
if(a[0]==0)
ans++;
}
return ans;
}