Question: SOLVE THE FOLLOWING IN HASKELL WITHOUT USING PRELUDE FUNCTIONS OR IMPORTING ANY LIBRARIES. You may make as many helper functions as needed. A maze can

SOLVE THE FOLLOWING IN HASKELL WITHOUT USING PRELUDE FUNCTIONS OR IMPORTING ANY LIBRARIES. You may make as many helper functions as needed.

A maze can be represented as a grid containing paths or multiple paths from the source to the destination. However, for simplicity we will be assuming that we only have NxN grids which will be represented as a 2d List / Array. We will also assume that Soomro and Ahmed are starting from the cell at list[0][0] and the destination is list[n-1][n-1].

However, the cells will be labelled as E or O where E stands for empty and O stands for obstacles. Your job is to find all the possible paths that can lead them from the start to the end. Do this by adding P to the cells that can form a path from the source to the destination and return the grid.

Please note that we can only travel to the right or bottom. For example:

SOLVE THE FOLLOWING IN HASKELL WITHOUT USING PRELUDE FUNCTIONS OR IMPORTING ANYLIBRARIES. You may make as many helper functions as needed. A maze

IT SHOULD PASS THE FOLLOWING TEST CASES:

can be represented as a grid containing paths or multiple paths from

With an input matrix of: There will be 2 corresponding paths as depicted in the following tables: Path a) Dath h) So the output will be: Note: No imports are allowed =

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

To solve this problem in Haskell without using Prelude functions or importing libraries we can follow these steps Create the Maze Traversal Logic Defi... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!