Answered step by step
Verified Expert Solution
Question
1 Approved Answer
We have a snail race we will have to determine the winner ! - The number of snails is given in the variable numberSnails. -
We have a snail race we will have to determine the winner
The number of snails is given in the variable numberSnails.
Each snail has a speed given in the variable speedSnail
You have a map of the game with a height of mapHeight and a width of mapWidth.
On the map we have:
number that represents a snail from to numberSnails
which represents a place where the snail can go
# which represents the destination
Snails can go right, left, up down. Snails cannot go diagonally.
The snail takes the path closest to itInput
Line : An integer numberSnails for the number of snails.
Next numberSnails lines: An integer speedSnail for the speed of a snail.
Next line: An integer mapHeight which is the height of the map.
Next line: An integer mapWidth which is the width of the map.
Next mapHeight lines: A string ROW for one line of the map.
Output
A number that represents the winner of the race
Constraints
numberSnails
speedSnail
mapHeight
mapWidth
Answer must be in Java
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