[dynamicprogramming] write code for minimum path sum