You are viewing a single comment's thread. Return to all comments →
Because of the relationship between the index and the correct_value, I don't think you even need the ref_arr. You can just replace:
correct_value = ref_arr[i]
with:
correct_value = i + 1
but I'm unsure if that's easier for readability or not.
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 →
Because of the relationship between the index and the correct_value, I don't think you even need the ref_arr. You can just replace:
correct_value = ref_arr[i]
with:
correct_value = i + 1
but I'm unsure if that's easier for readability or not.