Pseudocode Challenge
Challenge: Challenge: Minimum Steps in a Maze

 

Problem Statement:

You are given a 2D grid representing a maze where:

  • 0 represents an open path,
  • 1 represents a wall, and
  • S represents the starting point of the maze.
  • E represents the exit.

The goal is to find the minimum number of steps required to reach the exit from the starting point. You can move up, down, left, or right, but cannot move through walls.

If the exit cannot be reached, return -1.

Constraints:

  • The grid is an n x m matrix (1 ≤ n, m ≤ 100).
  • There is always exactly one starting point and one exit in the maze.
Write your pseudocode below