Advertisement
AlexKolotov

Untitled

Sep 28th, 2019
573
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.44 KB | None | 0 0
  1. def generate():
  2.     return []
  3.  
  4. def check(reply, clue):
  5.     if reply == '':
  6.         return False
  7.     ouf = int(reply)
  8.     c = clue.split()
  9.     ans = int(c[0].strip())
  10.     s = c[1].strip()
  11.     return ouf == ans or (0 <= ouf < len(s) and s[::-1] == s[ouf:] + s[:ouf])
  12.  
  13. tests = [
  14.     ("4\nabac\n", "3\nabac\n", "3"),
  15.     ("4\nabba\n", "0\nabba\n", "0"),
  16.     ("3\nbca\n", "-1\nbca\n", "-1"),
  17.     ("6\naabbcc\n", "-1\naabbcc\n", "-1")
  18. ]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement