how do i jump or to shuffle the next value in a list?
count = 0 # counter after the solution should be 7 a = ['1', '2', '3', '3', '5', '5', '6', '6', '7', '9'] # 5<->7 and 6<->9 b = ['0', '0', '2', '2', '3', '6', '6', '6', '7', '9'] count+=1 <<if a[i]>b[i] iterating through both the list together, whenever a[element]<b[element], i want to shuffle the current a[element] with a greater that is greater than the current b[element] too.. As in above case, a[elements] are greater than b[element] until a[5] comes during iteration, because a[5]<b[5]...so what i wanna do is find the next element in the "list a" which is greater than b[5] i.e 7..and shuffle 5 and 7 in the list 'a'.and comare with the current element in "list b"......and same for the further elements until list is over... and count+=1 when a[element]>b[element]... in the above case, count must be =7, because of shuffling 7 and 9 in "list a" hope you understand what i am trying to tell you!