Last time It's the 5th day. There is a contest today. Today's Contest
#5 Problem
** Thoughts ** 1WA. The question is to determine if the given string contains'ict'. It's important that you remove a few letters and become'ict', you can remove any of the'ict'. At first, I overlooked this condition, so I did WA. I improved it and converted it in order.
import re
s = str(input())
s = s.lower()
l = 'ict'
step = 0
for i in range(len(s)):
if s[i] == l[step]:
step += 1
if step == 3:
print('YES')
quit()
print('NO')
By specifying the index in step, it will search in order. s.lower () makes s all lowercase.
It is regrettable that I did WA even though it was a problem. Let's do our best in today's contest! see you
Recommended Posts