Question: solve by using java You have a rectangular board consisting of N rows, numbered from 1 to N, and M columns, numbered from 1 to
solve by using java



You have a rectangular board consisting of N rows, numbered from 1 to N, and M columns, numbered from 1 to M. The top left is (1,1) and the bottom right is (N,M). Initially, at time = 0, there is a coin on the top-left cell of your board. Each cell of your board contains one of the following characters: U: If a cell cell (i,j) contains the letter ', and that cell contains the coin at time t, then at time t+1 the coin will be on cell (1-1,j). If i1 then the coin leaves the board at time t+1 L: If a cell cell (i,j) contains the letter 'L', and that cell contains the coin at time t, then at time t+l the coin will be on cell (i,j-1). Ifj1 then the coin leaves the board at time t+1 D: If a cell cell (i,j) contains the letter D and that cell contains the coin at time t, then at time t+1 the coin will be on cell (1+1,j). If i = N then the coin leaves the board at time t+1. R: If a cell cell (i,j) contains the letter , and that cell contains the coin at time t, then at time t+l the coin will be on cell (i,j+1). If i = M then the coin leaves the board at time t+1. Exactly one cell on the board contains the'* character. When the coin reaches that cell, it will stay there permanently
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
