A robot starts in the top-left cell of a grid and may move only right or down. Some cells are blocked. How many different paths reach the bottom-right cell?
Write GridPaths with two recursive methods computing the same number: plain(r, c) and withMemo(r, c) (stores each cell's answer in a long[][] filled with −1). Count the calls of each (the exact counts depend on small details of your code, so the tests check only the first two lines). Input: rows cols k, then k blocked cells row col (0-based).
For the input
4 5 2
1 1
2 3
the program prints
Paths: 7
Same answer without memo: true
Calls without memo: 61
Calls with memo: 35