4 kyu

Simple maze

796 of 1,062eugene-katsevman

Description:

Kate constantly finds herself in some kind of a maze. Help her to find a way out!.

For a given maze and Kate's position find if there is a way out. Your function should return True or False.

Each maze is defined as a list of strings, where each char stays for a single maze "cell". ' ' (space) can be stepped on, '#' means wall and 'k' stays for Kate's starting position. Note that the maze may not always be square or even rectangular.

Kate can move left, up, right or down only.

There should be only one Kate in a maze. In any other case you have to throw an exception.

Example input

['# ##',
 '# k#',
 '####']

Example output

True

Example input

['####'.
 '# k#',
 '####']

Example output

False

Queues
Recursion
Algorithms

Stats:

CreatedFeb 10, 2016
PublishedFeb 10, 2016
Warriors Trained4373
Total Skips1340
Total Code Submissions10005
Total Times Completed1062
Python Completions796
Java Completions276
Total Stars161
% of votes with a positive feedback rating96% of 248
Total "Very Satisfied" Votes230
Total "Somewhat Satisfied" Votes17
Total "Not Satisfied" Votes1
Total Rank Assessments6
Average Assessed Rank
4 kyu
Highest Assessed Rank
4 kyu
Lowest Assessed Rank
6 kyu
Ad
Contributors
  • eugene-katsevman Avatar
  • smile67 Avatar
  • Blind4Basics Avatar
  • saudiGuy Avatar
Ad