Shortest 6 Wrap up

This codefu shortest was again all about python.

The winner is: lazzrov

Also special congratulations to best problem solutions:

Problem 100: mmarko, whoeverest with 414 points
Problem 200: mmarko with 348 points
Problem 300: lazzrov with 332 points

Problem 1

Problem description
The solution to the problem is very short and easy by combining join and sort.
One trick is to use split() that defaults to split(" "), saving 2 characters
The second trick was to map a sorted function to a variable, saving additional 2 characters.

Problem 2

Problem descrption
The solution is to split and sort the sizes of the box, so that the comparision can easilly be done in one for cycle.
Again, there is one trick to define one lambda function for the split and sort and use it twice on the object and the box.

Problem 3

Problem description
This problem was tricky, by the fact that we needed to split the input string by ',' and then by the '-'
lazzrov found a very neat trick with re.split("\D",y) which splits the whole input string into one array
Then by iterrating through this array two by two elements, he is able to merge and construct the solution

Hint: Two by two elemens for x,y in sorted(zip(v[::2], v[1::2])):

Hint: Format the output with python templates "%d,%d-" % (b,x)

New topic