Problem link—110A – Nearly Lucky Number
/*
Harun-or-Rashid
CSEDU-23rd Batch
*/
#include <bits/stdc++.h> using namespace std; int main() { int i,cnt=0; char s[20]; scanf("%s",s); for(i=0; i<strlen(s); i++) { if(s[i]=='4'||s[i]=='7') { cnt++; } } if(cnt==4||cnt==7) printf("YES\n"); else printf("NO\n"); return 0; }
Tasnim Ahmed
I think the solution is wrong. Can you please check it again??
Harun-or-Rashid
No, The solution is correct. Accepted solution by Codeforces
MD SHAKIBUL HOSSAIN SIKDER
your logic is right