The Konami code is a sequence of key/button presses that is implemented in many video games to unloc…
Click here to read the complete problem statement.
If you need help solving this problem, mention your approach and ask specific questions. Please avoid sharing your code and asking the Community to figure out “what’s wrong”.
It is easy for python 3. It just needs a line to be solved.
. Just take a string
. And count the ‘konami code’ from there uaing count method.
. Then print that.
konami = str(input())
con=""
li = list(konami)
m=10
count=0
i=0
lenth = len(li)
for i in range(lenth):
for j in range(i,m):
con += li[j]
if con=="UUDDLRLRBA":
count+=1
m+=1
con=""
if m>=lenth:
break
print(count)
what is the problem my code
test case 7 has run time eroor