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.
Sounds like you're not doing a true insertion sort. In order it to be a true insertion sort, you have to move that 3 to the left two times. I.e.: "4 3 4 4" then "3 4 4 4".
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Running Time of Algorithms
You are viewing a single comment's thread. Return to all comments →
Sounds like you're not doing a true insertion sort. In order it to be a true insertion sort, you have to move that 3 to the left two times. I.e.: "4 3 4 4" then "3 4 4 4".