79759570

Date: 2025-09-09 06:44:00
Score: 1
Natty:
Report link

You must starting the search from the index immediately following the first found occurrence for overlapping, like this:



y=input()
m=0
n='NO'
if y.find('AB')!=-1:
    m=y.find('AB')
    if y.find('BA',m+2)!=-1:
        n='yes'
    else :
        n='NO'
print (n)
Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: user3041971