Presort array by recursive

while 1:
 l=o=[]
 for v in input():o+=[[]]*(v<l);o[-1]+=v,;l=v
 print`sum(sorted(o),[])`.replace(" ","")

Note that non-ascii characters in the above source code will be escaped (such as \x9f).

download

return to the top page