4 kyu

Simple maze

777 of 1,043eugene-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 Trained4335
Total Skips1331
Total Code Submissions9911
Total Times Completed1043
Python Completions777
Java Completions276
Total Stars160
% of votes with a positive feedback rating96% of 242
Total "Very Satisfied" Votes225
Total "Somewhat Satisfied" Votes16
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