Your code is returning [7, 6, 3, 8, 9] whereas expected is [9, 7, 6, 3, 8]. Seems like logic is not working well.