unique paths with obstacles using dynamic programming