• + 4 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.