Question: In c++ please This program will get as input the size of the grid that is N by M, and the coordinates of the set

In c++ please

In c++ please This program will get as input the size ofthe grid that is N by M, and the coordinates of the

This program will get as input the size of the grid that is N by M, and the coordinates of the set of square that are marked as "wall" (or "off"), and print to the console the number of ways to get square "start" to square "end". The square "start" is the bottom left square and the "end" is the top right square in the gird. The only moves allowed is going right and up. For example, in the grid below (on the left), the different routes from start to end is URR, RRU, and RUR. The program simply prints 3 to the console. Note that in this example no square is specified as "wall". But in the second example (on the right), the only route from start to end is JRR. Look at example below. This is a 6 by 8 grid. (For the purpose of demonstration in this document, the grid is shown by a 2D array, the "wall" squares are denoted by 1,) and "free" squares by O. You can of course implement any other mechanism to represent this grid in your program) This program will get as input the size of the grid that is N by M, and the coordinates of the set of square that are marked as "wall" (or "off"), and print to the console the number of ways to get square "start" to square "end". The square "start" is the bottom left square and the "end" is the top right square in the gird. The only moves allowed is going right and up. For example, in the grid below (on the left), the different routes from start to end is URR, RRU, and RUR. The program simply prints 3 to the console. Note that in this example no square is specified as "wall". But in the second example (on the right), the only route from start to end is JRR. Look at example below. This is a 6 by 8 grid. (For the purpose of demonstration in this document, the grid is shown by a 2D array, the "wall" squares are denoted by 1,) and "free" squares by O. You can of course implement any other mechanism to represent this grid in your program)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock 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!