X

DAYS

:

HOUR

:

MINS

:

SEC

Maximize energy of airplane

image

Given N*5 matrix each cell contain elements from set {0,1,2} . The airplane can move to up, diagonally left or diagonally right you have to collect a maximum number of 1's means maximize energy.

0 -> Empty cell Airplane can move to this cell without loss of energy

1 -> Increase energy by +1

2 -> Bomb ( decrease energy by 1)

Energy can't be negative at any point of time.

Note: - Airplane have one special power at any point of time it can apply this power to remove all bombs means 2's and turn them into 0's only for particular 5*5 matrix from any row,

 

 

Author: nish
Login to Answer
Sort By:
Oldest
|
Newest
|
Vote
|
My Answer