Beginner problem based on Queue "Little Monk and Goblet of Fire"

Problem: Programming tutorials, Coding problems, and Practice questions

My code: Little Monk and Goblet of Fire - Pastebin.com

I have simply used brute force.

input:
14
E 1 1
E 2 1
E 1 2
E 2 2
E 1 3
E 3 1
E 3 2
D
D
D
D
D
D
D

output://getting
1 3
1 2
1 1
2 2
2 1
3 2
3 1

//should be
1 1
1 2
1 3
2 1
2 2
3 1
3 2

What’s wrong with my code? Thanks.

1 Like