+Develer's Sequence Challenge.

+ def __init__(self, sequence):

+ self.sequence = list(sequence)

+ self.solution = sorted(sequence)

+ self.length = len(self.sequence)

+ def _move(self, x, pos):

+ if not self.sequence.index(x) == pos:

+ self.sequence.remove(x)

+ self.sequence.insert(pos, x)

+ def move_bottom(self, x):

+ self._move(x, self.length)

+ return self.sequence == self.solution

+ return 'Game({0.sequence}) solved={0.solved}'.format(self)

+def ordered_groups(sequence):

+ Extract all the groups of ordered numbers in the sequence.

+ smaller_nums, group, larger_nums.

+ smaller_nums are the numbers, not in the ordered group, smaller than the

+ first element of the group.

+ larger_nums are the numbers, not in the ordered group, larger than the last

+ For example, having the sequence

+ the first group of ordered numbers would be

+ smaller_nums would then be

+ solution = sorted(sequence)

+ return solution[solution.index(x)+1]

+ if not start in starts:

+ larger_nums = sequence[:]

+ next_expected = subsequent_of(x)

+ yield smaller_nums, result, larger_nums

+def larger_group(s1, s2):

+ # reduce(larger_set, ordered_groups(sequence))

+ return (s2, s1)[len(s1[1]) > len(s2[1])]

+ (smaller_nums, ordered,

+ larger_nums) = reduce(larger_group, ordered_groups(game.sequence))

+ for n in sorted(smaller_nums, reverse=True):

+ for n in sorted(larger_nums):

+if __name__ == '__main__':

+ sequence = [58, 29, 97, 12, 70, 30, 16, 99, 24, 33, 69, 98, 35, 47, 52]

+ print tyrion_solve(game)