Total swap required =$1+1+1+1+3=7$
@prajjwal_191 I did not understand how they randomly just swapped the elements in the end
@Hira Thakur your answer is more convincing if we consider the direction from left to right. thankyou
I hope you got it thankyou.
@Hira Thakur yupp mistakenly I wrote 17 as 7. Thank you for figuring it out.
64.3k questions
77.9k answers
244k comments
80.0k users