1. Matrix Path Counting
In a matrix, you can move from the top-left corner to the bottom-right corner by moving right, down, or diagonally down-right. How many different paths are there? Discuss an optimized dynamic programming solution that uses linear space and explain your approach.