Incosistency in the output shown in submit and manual testing

Manual testing with this input (A : [ 0, 1, 1, 1, 1, 1, 2, 2, 2, 3, 3 ]) me correct ans: [0,1,2,3] but on submit answer it says wrong answer with output as: [0,1,2]

Click here to start solving coding interview questions