Back
Close

The Shortest Maze & Path

Statement

 Goal

You got lost in a size 5x5 mini maze.
The starting point is (1,1) and the goal is (3,3), always the same.

The outside of the maze is always a wall.


Please lead to the goal in the shortest distance.
The moving method is familiar L, R, U, D.

There is always one way to answer.
Input
5 lines: a string LINE where ”.” is a path and "#" is a wall
Output
Line 1 : The shortest path.
ex. RRDD
Constraints
LINE length 5
Example
Input
#####
#.###
#.###
#...#
#####
Output
DDRR

Game modes
Fastest

Test cases
L Test
Input
##### #.### #.### #...# #####
Output
DDRR

Validator 1 Validator
Input
##### #...# ###.# ###.# #####
Output
RRDD

C Test
Input
##### #...# #.### #...# #####
Output
DDRR

Validator 2 Validator
Input
##### #...# ###.# #...# #####
Output
RRDD

H Test
Input
##### #.#.# #...# #.#.# #####
Output
DRRD

Validator 3 Validator
Input
##### #...# ##.## #...# #####
Output
RDDR

W Test
Input
##### #.### #..## ##..# #####
Output
DRDR

Validator 4 Validator
Input
##### #..## ##..# ###.# #####
Output
RDRD

1 Test
Input
##### #..## ##.## #...# #####
Output
RDDR

Validator 5 Validator
Input
##### #...# ##.## ##..# #####
Output
RDDR

Solution language

Solution

Stub generator input