Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- n = int(input())
- s = input()
- s_now = s
- for i in range(n):
- if s_now == s[::-1]:
- print(i)
- break
- else:
- s_now = s_now[1:] + s_now[0]
- if s_now != s[::-1]:
- print(-1)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement