Wrong expected output for the problem


#1

run this in expected output 6 1 1 2 2 2 3 4
ie, size =6 ; ans elements : 1 1 2 2 2 3 4
expected output should be 1 1 2 2 3 4 and should return 5 ;
but here it is showing expected output as 1 1 2 2 3 ie last elements is not being showed therefore i tink checker is buggy


#2

The expected output is correct.You are entering array length as 6 but it is actually 7.
so input you are trying to give should be 7 1 1 2 2 2 3 4