ddinhminhhair's blog

By ddinhminhhair, history, 4 years ago, In English

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.

Full text and comments »

  • Vote: I like it
  • 0
  • Vote: I do not like it