Meta Interview Question

2 coding problems about matrix and trees