We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
...because the i + 1 assumption is wrong. If you have a consecutive array that doesn't start from one or if it's an array of even or odd numbers, then this logic would fail.
Minimum Swaps 2
You are viewing a single comment's thread. Return to all comments →
...because the i + 1 assumption is wrong. If you have a consecutive array that doesn't start from one or if it's an array of even or odd numbers, then this logic would fail.