Question
Dungeon Hunters Mustata wants to cross a dungeon. Dungeon has N cells, and in every cell there are M monsters. To cross each cell he
Dungeon Hunters
Mustata wants to cross a dungeon. Dungeon has N cells, and in every cell
there are M monsters. To cross each cell he has to kill one monster, on
killing the monster,
he loses the strength equal to that of monster and gains some confidence which adds up in his strength and he proceeds to the next cell. Mustafa
can only kill a monster if his strength is greater than or equal to the strength of the monster.
10
11
Help him find the minimum strength he must have in the beginning so
that he can cross N cells.
12 13
14
**CONSTRAINTS:**
15
16
1 1 17 18 1 19 20 21 "FUNCTION DESCRIPTION" Complete the function 'hunt' in code. Function must return an integer, the minimum strength required by mustafa to cross the dungeon. 22 23 24 Outpu in a single w followed by elements of row wise ele 17.8.91 10.1 2312.345 Use custom hunt' has the following parameter(s): Input P. N'M 20 Array, where P[][i] denotes strength of jth monster in ith cell CN'M 20 Array, where Cilil denotes gain in confidence, hence increase in strength on killing jth monster in ith cELL N Number of cell M Number of monsters in each
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