Not geeting the exact output geeting 2 three times

hello @anshulgurawalia

check now->

This output is also incorrect
the correct output of the test case would be :
[1, 1, 2, 2, 3]

check now->

not passing the test cases

check our output , it is printing extra comma in the end