Given a grid where each cell holds 1 (a cherry), 0 (empty), or -1 (a thorn that blocks movement), start at the top-left and move only right or down to reach the bottom-right, collecting cherries. Return the maximum cherries collected on one trip, or 0 if the bottom-right is unreachable. The input is JSON {grid}.
Input: JSON {grid}.
Output: Integer — the maximum cherries collected.
Input: {"grid":[[0,1,-1],[1,0,-1],[1,1,1]]}
Output: 4
Explanation: Collect four cherries down the left side.Input: {"grid":[[1,1],[1,1]]}
Output: 3
Explanation: Collect three on one trip.Input: {"grid":[[1]]}
Output: 1
Explanation: Single cherry.1<=rows,cols<=50