You are viewing a single comment's thread. Return to all comments →
could you please explain me what this line does? " arr[arr[i]-1], arr[i] = arr[i], arr[arr[i]-1] "
seems weird...
EDIT: hmm, think i found it it's like a,b = b ,a that simply exchanges position in a and b
Seems like cookies are disabled on this browser, please enable them to open this website
Minimum Swaps 2
You are viewing a single comment's thread. Return to all comments →
could you please explain me what this line does? " arr[arr[i]-1], arr[i] = arr[i], arr[arr[i]-1] "
seems weird...
EDIT: hmm, think i found it it's like a,b = b ,a that simply exchanges position in a and b