Problem Statement | |||||||||||||
*** You may only submit a given problem once - no resubmissions will be accepted. *** You have been given the opportunity of a lifetime. You and your friend get to run through a field full of money. Everything you and your friend pick up, you can keep. You will be given a String[] grid containing the locations of the prizes. Each character in grid will be a digit from 0-9 determining how much money is located in that particular location. The elements of grid will be the rows of the field. You and your friend will begin at row 0 column 0 of grid (element 0 character 0). Using only steps to the right and steps down, return the maximum amount of money both of you can collect. Here 'right' means increasing column value and 'down' means increasing row value. Note that you and your friend can take different routes. If you and your friend visit the same location, only one of you can pick up the money at that location. Both you and your friend will always end up on the lower rightmost location when you finish. | |||||||||||||
Definition | |||||||||||||
| |||||||||||||
Constraints | |||||||||||||
- | grid will contain between 2 and 7 elements inclusive. | ||||||||||||
- | Each element of grid will contain between 2 and 7 characters inclusive. | ||||||||||||
- | Each element of grid will contain the same number of characters. | ||||||||||||
- | Each character in grid will be a digit ('0'-'9'). | ||||||||||||
Examples | |||||||||||||
0) | |||||||||||||
| |||||||||||||
1) | |||||||||||||
| |||||||||||||
2) | |||||||||||||
| |||||||||||||
3) | |||||||||||||
|