Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def CheckAnswer(pairs, gluingSequence):
- if not gluingSequence:
- return False
- def Glue(pairIndex):
- return ''.join(pairs[i][pairIndex] for i in gluingSequence)
- return Glue(0) == Glue(1)
- def FindGluingSequence(pairs):
- # FIXME This should actually return something.
- return None
- if __name__ == '__main__':
- pairs = [
- ('ab', 'a'),
- ('bbaaba', 'a'),
- ('b', 'bbbb'),
- ('bb', 'ab'),
- ]
- print CheckAnswer(pairs, [0, 2, 1, 3, 3, 2])
- print CheckAnswer(pairs, [2, 1, 3, 3, 2, 0])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement