Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def generate():
- return []
- def check(reply, clue):
- if reply == '':
- return False
- ouf = int(reply)
- c = clue.split()
- ans = int(c[0].strip())
- s = c[1].strip()
- return ouf == ans or (0 <= ouf < len(s) and s[::-1] == s[ouf:] + s[:ouf])
- tests = [
- ("4\nabac\n", "3\nabac\n", "3"),
- ("4\nabba\n", "0\nabba\n", "0"),
- ("3\nbca\n", "-1\nbca\n", "-1"),
- ("6\naabbcc\n", "-1\naabbcc\n", "-1")
- ]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement