Given a non empty M x N matrix with numbers. Starting from row 0 to row M-1.
You can pick at most one number from each row.
Find the max length of longest increasing sequence.
First line contains a number M
Second lines contains a number N
The rest M lines would have N number each line separated by space
Output a number indicates the answer
4
4
2 2 1 4
10 6 4 8
3 7 9 10
3 3 3 9
4
[2 , 6 , 7 , 9]
3
3
1 1 1
1 1 1
1 1 1
1
4
3
1 1 1
3 3 3
2 2 2
4 4 4
3
[1 , 3 , 4] would be the answer
$ 1 \le M*N \le 4000 $
$ -10^{4} \le Matrix_{ij} \le 10^{4} $