Suppose I have 4 rows of numbers(The row size is n)
a1, a2 , a3 ,... an
b1, b2 , b3 , ....,bn
c1, c2, c3,... cn
d1, d2, d3,... ,dn
I need to find number of ways to select numbers from each row exactly once such that a < b < c < d.
For example if rows are 2,3,4,5
3,4,5,6,
4,5,6,7,
5,6,7,8
Then one possible way is (2,4,6,8) ; select 2 from first row, 4 from second and so on.
Other than brute force , what could be another way of solving this problem? [Note: brute force cant be used if length of rows is large]