The problem of verification the answers in 110A — Nearly Lucky Number

Revision en2, by ddinhminhhair, 2023-01-19 10:30:28

Hello, Codeforces!

I have solved the problem 110A — Nearly Lucky Number. Then, I start find more optimal solution by referring to the others' one. What I found is

print('NYOE S'[sum(i in'47'for i in input())in(4,7)::2])

But this short code return the wrong answer NO for the input 47474747474747474747474747474747474747474747474 — there are 47 lucky digits. Unfortunately, it was an accepted solution.

Please help me for check it!!! Thanks everyone.

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en3 English ddinhminhhair 2023-01-19 10:33:33 0 Tiny change: 'Hello, Cod' -> '[user:MikeMirzayanov]Hello, Cod' (published)
en2 English ddinhminhhair 2023-01-19 10:30:28 76
en1 English ddinhminhhair 2023-01-19 10:24:23 597 Initial revision (saved to drafts)