An array of arrays of integers is read from standard input, each of the inside arrays having the same length. These numbers correspond to the values of the homes in a rectangular neighborhood, laid...




An array of arrays of integers is read from standard input, each of the inside arrays having the same length. These numbers correspond to the values of the homes in a rectangular neighborhood, laid out in a grid.






Then an array of chars is read from standard input, consisting of just 'r', 'l', 'd', and/or 'u'. This second array describes a set of directions for walking from the top-left corner (0, 0) of the grid to some other home. Characters 'r' and 'l' move you right (+1) or left (-1) within an array, and characters 'u' and 'd' move you up (-1) or down (+1) among the arrays.








Your job is to follow the directions, and print out the value of the home you are at when your walk ends.








For example, if the value array is:







[[1, 2, 3],








[4, 5, 6]]





And the directions array is

[r,d,r,u,l,l,d], then you would print out

The house value is 4.


Mar 10, 2023
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here