Remove duplicates

I didn’t understand why the editorial said to remove duplicates from array if we remove the duplicates we will not be able to find thr valid answer of 1 1 6 and could you please tell me how to remove duplicates answer from output.

hey @jaiswaldhruv007
in input we have 2 ones in the input and in this way we have to print the result .
and in the lines which you mentioned above we are marking the prev and if the prev is the marked then we cannot take the number .
but in the above example we have 2 one’s thats why we have to can print both the 1’s .
if you still have any doubt please ask here .
Happy Learning !!

sorry i didn’t understand what do you mean by marking the previous and if previous is marked we cannot take that number

say array is
5 1 1 and target sum is 6
now
we do take 5 take 1 skip 1 and sort and print 1 5
now we go back but op array is still sorted because passed by reference so next time we overwrite op array it overwrites 5 andmake it 1 1
I hope you got it now.

hey i’m still not able to understand can you please dry run the solution on the given sample so that i can understand better ,thanks