bubble sort in the function "get_next()"

input1:1234
output1:1234-> 3087-> 8352-> 6174-> 6174
input2:3456
output2:3456-> 3087-> 8352-> 6174-> 6174