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.
I have a flag which gets set if the array cannot be sorted. Once the flag was set, I was not resetting it for the next input. This caused only test case 1 and 8 to pass. Once I fixed this, the remaining cases passed. Hope this helps.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Roads and Libraries
You are viewing a single comment's thread. Return to all comments →
I have a flag which gets set if the array cannot be sorted. Once the flag was set, I was not resetting it for the next input. This caused only test case 1 and 8 to pass. Once I fixed this, the remaining cases passed. Hope this helps.