why my solution of DESTROY problem wrong?

my solution link is link text

Theres the counter case-

Input
1
6
1 2 3 3 5 6
Your Output
4
Expected Output
3 //Remove 1,3 then 2,3 and then 5,6.

@vijju123 please answer.

please answer if anyone knows or has solved this problem

Sorry, i didnt have a look here. Looking into the question right away.

Thanks for your reply