change below example
int arr [ ] = { 1 , 2 , 5 , 3 , 4 } ; int N = sizeof ( arr ) / sizeof ( int ) ; int res = minSwapToReachArr ( arr , N ) ; if ( res == -1 ) cout << " Not ▁ Possible STRNEWLINE " ; else cout << res << endl ; return 0 ; }