Source Code
length=int(input())
ch=input()
ch1=ch[1:-1]
if ch1 in ch:
    print(length-2)
else:
    print(0)
Copy
Pop Pop samou
Python 3
15 ms
3.8 MB
Wrong Answer