SAP OA

Given an array return an integer indicating the minimum number of swap operations required to sort the array into ascending order.

Examples:-
1.)
arr=[5,1,3,2]
final_arr=[1,2,3,5]
minimum no. of swaps = 2

2.)
arr=[1,3,2]
final_arr=[1,2,3]
minimum no. of swaps = 1

你好,请问你这个是哪个岗位的OA呀,我听说他家的OA是没有test case的?但这个是hackerrank吧?

就是 General SDE

哦哦好的,谢谢!