Gamified challenge · Asked in Accenture
Somewhere on the board are locked doors 🚪. Walk into one and the game is over, so plan your route to the key 🔑 before you take a step. The board is a list of rows: . is floor, P is you, K is the key and D is a locked door.
Write findKey(board) (find_key in Python) that returns your moves as a string of U, D, L and R. Any route that reaches the key without stepping on a door or off the board passes.
Accenture's round games are free with an account: write your answer in Java or Python, watch it play out, and step through the algorithm.
Sign in with Google