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.
well why do I have to assign the value into the new temp array?
all what you did is counting all displaced elements, I did similar try earlier but it passed only 4 cases.
Cookie support is required to access HackerRank
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 →
well why do I have to assign the value into the new temp array? all what you did is counting all displaced elements, I did similar try earlier but it passed only 4 cases.