

Int ans = cur + max(op1, max(op2, max(op3, op4))) The driver can contain a maximum of 5 passengers by taking the following path The driver can contain a maximum of 2 passengers by taking the following path Int:maximum number of passengers that can be collected.Move down one to the destination.Cell (1,0) is blocked,So the return path is the reverse of the path to the airport.All Paths have been explored and one passenger is collected. Start at top left corner.Move right one collecting a passenger. The goal is to collect as many passengers as possible so that the driver can maximize his earnings.


The rules of motion of taxi are as follows: A value equal to -1 represents an obstruction.A value equal to 1 represents a passenger.A value greater than or equal to zero represents a path.The Matrix is filled with cells,and each cell will have an initial value as follows: A taxi can take multiple passengers to the railway station at the same time.On the way back to the starting point,the taxi driver may pick up additional passengers for his next trip to the airport.A map of passenger location has been created,represented as a square matrix.
