To count the number of shortests paths, I filled a table paths[len]

*[j][food] = number of different paths of length "len" ending at state [i, j, food].*

However, my solution is rather slow. I've seen some people ranked with times < 0.010. What's the fastest method to solve this problem?

However, my solution is rather slow. I've seen some people ranked with times < 0.010. What's the fastest method to solve this problem?