Problem 1301 · Hard
Work backward from the start, keeping the best score and the number of paths that reach it in each cell.
Open the interactive visualisation