Problem 1301 · Hard

Number of Paths with Max Score

Work backward from the start, keeping the best score and the number of paths that reach it in each cell.

Open the interactive visualisation