MaxMinSwap by leonid

while 1:a=input();s=sorted(a);i=0;exec'a[a.index(s[i])]=`s[~i]`;i=~i-i/9;'*len(a);print'[%s]'%','.join(a)

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

download

return to the top page