ANTEATER-New Approach

Hey, I tried to solve ANTEATER of june cookoff contest with using just set and vector.
However, I tried it and got all custom test cases passed but getting WA in the following code:
It would be great help, if someone figure out mistake.

Update: A new Approach for solving ANTEATER:
Code is ez to understand on own.

3 4
Output : 1
Hmm…I think Expected output would be 6 :smile:

1 Like

YEAH GOT AC, that was silly mistake. Thanks :smile::smile::smile::smile: