There is a problem: The first person (who starts over) must reach the final box āeā, so that the second person ālā (whenever he is) could not catch the first person. Men can go left, right, up, down, or can stay.
For instance:
Input: 6 7 RRRRRRR R_e___R R_____R R_RRR_R R_gRl_R RRRRRRR
The answer is "YES" because there is a way ("Left", "Up", "Up", "Up", "Right").
How can this problem be implemented?
I use BFS and DFS. Here is my code
#include <iostream>
Here is the second code:
#include <iostream>
EDIT (By Jarod42):
I found a complex map that failed:
9 9 RRRRRRRRR R...Rg..R R.RlRRR.R RR..RR R.RRR.RR R.Re....R RRRRR.R R.......R RRRRRRRRR
l cannot protect both accesses e .
or even easier
RRRRRRRRRR R...RRRRRR RR..RRRR RlReR...gR RR..RRRR R...RRRRRR RRRRRRRRRR
source share