2 deleted 2 characters in body
source | link

Python (69 chars)

from random import*
def f(a):
 while a>sorted(a):shuffle(a)
 return a

Sorts integers in increasing numeric order. Note that recursive solutions, like

from random import*;f=lambda a:a==sorteda>sorted(a)and a or(shuffle(a)or f(a))or a

will fail due to stack overflow for even small inputs (say N>5), because Python does not do tail-call optimisation.

Python (69 chars)

from random import*
def f(a):
 while a>sorted(a):shuffle(a)
 return a

Sorts integers in increasing numeric order. Note that recursive solutions, like

from random import*;f=lambda a:a==sorted(a)and a or(shuffle(a)or f(a))

will fail due to stack overflow for even small inputs (say N>5), because Python does not do tail-call optimisation.

Python (69 chars)

from random import*
def f(a):
 while a>sorted(a):shuffle(a)
 return a

Sorts integers in increasing numeric order. Note that recursive solutions, like

from random import*;f=lambda a:a>sorted(a)and(shuffle(a)or f(a))or a

will fail due to stack overflow for even small inputs (say N>5), because Python does not do tail-call optimisation.

1
source | link

Python (69 chars)

from random import*
def f(a):
 while a>sorted(a):shuffle(a)
 return a

Sorts integers in increasing numeric order. Note that recursive solutions, like

from random import*;f=lambda a:a==sorted(a)and a or(shuffle(a)or f(a))

will fail due to stack overflow for even small inputs (say N>5), because Python does not do tail-call optimisation.