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:
https://www.codechef.com/viewsolution/24957588
It would be great help, if someone figure out mistake.

Update: A new Approach for solving ANTEATER:
https://www.codechef.com/viewsolution/24958103
Code is ez to understand on own.

Input:
3 4
-D–
R-L-
-U–
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: