Advertisement
Nenogzar
Feb 12th, 2024
84
0
Never
This is comment for paste 3. Kate's Way Out
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. 3. Kate's Way Out
  2. Kate is stuck in a maze. You should help her to find her way out.
  3. On the first line, you will be given how many rows there are in the maze. On the following n lines, you will be given the maze itself. Here is a legend for the maze:
  4. • "#" - means a wall; Kate cannot go through there
  5. • " " - means empty space; Kate can go through there
  6. • "k" - the initial position of Kate; start looking for a way out from there
  7. There are two options: Kate either gets out or not:
  8. • If Kate can get out, print the following:
  9. "Kate got out in {number_of_moves} moves".
  10. Note: If there are two or more ways out, she always chooses the longest one.
  11. • Otherwise, print: "Kate cannot get out".
  12.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement