You are viewing a single comment's thread. Return to all comments →
Check it for reverse array1: 1 3 5 2 - it require two swaps. We are only taking min of ascending and descending.
Lily's Homework
You are viewing a single comment's thread. Return to all comments →
Check it for reverse array1: 1 3 5 2 - it require two swaps. We are only taking min of ascending and descending.