The first round of the facebook hackercup 2012 had three problems. All problems have to be solved in 24 hours and coders with three successful solved entries goes to round 2.
The problem “Recover the Sequence” can be solved in two lines of code (+ some lines for input and output).
Recover the Sequence – problem
Merge sort is one of the classic sorting algorithms. Conceptually, a merge sort works as follows. Divide the unsorted list into n sublists (n is 2 in the example), each containing 1 element (a list of 1 element is considered sorted). Repeatedly Merge sublists to produce new sublists until there is only 1 sublist remaining. (This will be the sorted list.)
The problem description starts with the pseudo code – I translated into a python class.

