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
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]