Microsoft interview question

2D Dynamic programming usage in matrix