fork download
  1. import random
  2.  
  3. def Q(A):
  4. if len(A)<2: return A
  5. p = A[0]
  6. return Q(filter(lambda x: x<p, A)) + \
  7. filter(lambda x: x==p, A) + \
  8. Q(filter(lambda x: x>p, A))
  9.  
  10. A = [random.randint(0, 100) for x in range(12)]
  11. print (A)
  12. print (Q(A))
Success #stdin #stdout 0s 32920KB
stdin
Standard input is empty
stdout
[12, 8, 20, 1, 80, 49, 53, 14, 8, 47, 35, 96]
[1, 8, 8, 12, 14, 20, 35, 47, 49, 53, 80, 96]