I have an unsorted list lis=[4,2,1,3]
using the sort function I get the value as lis=[1,2,3,4]
now the numbers 1,3,4 have been shifted making the shift count to 3 shifts. How do I count the number of shifts in Python?
Asked
Active
Viewed 120 times
0

Ch3steR
- 20,090
- 4
- 28
- 58

Glen Veigas
- 186
- 11