Last time I have only one question today.
#54 Problem
** Thoughts ** I'm not good at manipulating strings, so I chose this one. I solved it once before, but I've escaped so I'll solve it. Since the length of $ S $ is small enough, we will search all the points to be carved. Note that it is carved only at one point.
s = input()
flag = False
n = len(s)
for i in range(n):
for j in range(i,n):
if 'keyence' == s[:i] +s[j:]:
flag = True
if flag:
print('YES')
else:
print('NO')
I want to be brown in today's ABC. Let's do our best for ABC today! See you again.
Recommended Posts