Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- a=int(input())
- slovo=input()
- count=0
- slovo2=slovo[::-1]
- if slovo==slovo2:
- count=0
- else:
- while slovo!=slovo2:
- if count>=a:
- count=-1
- break
- word=slovo[:1]
- slovo=slovo[1:]
- slovo+=word
- count+=1
- print(count)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement