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.
The provided examples are misleading. I was left with the understanding that the result of the series of swaps must be the array sorted in ascending order, because all examples given produce the array sorted in ascending order.
This caused me a lot of time to understand why the answer for [3, 4, 2, 5, 1] was 2 and not 4.
It would be really bad if such misleading problem stories happen actually at an interview.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Lily's Homework
You are viewing a single comment's thread. Return to all comments →
The provided examples are misleading. I was left with the understanding that the result of the series of swaps must be the array sorted in ascending order, because all examples given produce the array sorted in ascending order.
This caused me a lot of time to understand why the answer for [3, 4, 2, 5, 1] was 2 and not 4.
It would be really bad if such misleading problem stories happen actually at an interview.