How can i create a function which sort a list in this way for example if list 4,4,2
If the list is impossible to sort then the program have to try it 15 times not more.
The function which I wrote does it only one time not more??
x=[4,4,2] def kopi(x): b=0 y =  for j in x: b+=1 y.append(j-1) y.append (b) print y,b return y
can anyone help me?
Thanks a lot for all help and advice.