Solution to the min path sum problem.

Can be improved using more advanced algorithms, but the naive solution
seems to get 100%, so going with this for now.