299

Train Swapping
Type: Sorting & Searching  
Diff: 2.5

Tricks

This is nothing but a bubble sort problem. You have to sort the carriages with bubble sort and count the number of swap. Remember bubble sort is the only sorting process where the adjacent elements are swapped.  

If you have any advice, complements 

or proposal, please  Send mail to Author

Submit

 

1