| 3 | And checked if the iterator returned by the last value of matches with the iterator returned by set end*/ |
| 4 | using namespace std; |
| 5 | int main(){ |
| 6 | long n,val,count=0; |
| 7 | cin>>n>>val; |
| 8 | for(int i=0;i<n;i++){ |
| 9 | long num; |
| 10 | cin>>num; |
| 11 | set<int> S; |
| 12 | while(num>0){ |
| 13 | S.insert(num%10);//takes only unique digits of the number |
| 14 | num=num/10; |
| 15 | } |
| 16 | int flag=0; |
| 17 | for(int j=0;j<=val;j++){ |
| 18 | if(S.find(j)==S.end()){ |
| 19 | flag=1; |
| 20 | } |
| 21 | } |
| 22 | if(!flag){ |
| 23 | count++; |
| 24 | } |
| 25 | } |
| 26 | cout<<count; |
| 27 | return 0; |
| 28 | } |