Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Examples: map = ' . UT ' ; ' . . . ' ; ' . X . ' ; ' C . G '
Examples:
map
UT;
;
X;
CG ;
directions
attractions
Crash;
'Tower';
'Giga!;
'Usurp'
finalMap route gtNightAtSixFlags map attractions,
direction
finalMap
;
#;
#X#
###
route I went to GT Night at Six Flags and rode Crash,
Giga!, Tower, Usurp!
Notes:
Each attraction in the output string will be separated by a single comma and space
You will never cross over the same path previously traveled or travel outside of the
matrix dimensions
Do not replace the final location with a # but do replace the initial location with a
#
You only alter directions for the attractions you encounter on your path, there may be
extra characters you don't hit
There should not be a comma and space after the last attraction listed in the output
string
You are not guaranteed to visit every attraction, you might not visit any attractions
at all, in which case the outputted sentence would be: 'I went to GT Night at
Six Flags and rode
need code for matlab
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started