Compute longest increasing path in matrix | Snapchat Interview Question