#include
using namespace std;
int main() {
int n;
cin>>n ;
int d;
cin>>d;
int count=0;
while(n!=0){
if (n%10==d){
count++ ;
}
n=n/10;
}
cout<< count ;
return count;
}
Please tell the mistake in my logic as in 2 test cases I am getting run time error and @ testcases are correct…
Please tell me