Amazon Interview Question

2 coding questions. One related to matrix, other related to dynamic programming.