Code Chef problem INCRDEC

I don’t know where my test case is failing . Can anybody check it ?

There are two conditions that you have to check.

  1. The greatest number should not occur twice
  2. Any number should not occur thrice.

I have implemented the same logic in my solution.

If you want you may have a look and then debug. I thinks it is understandable.