I have n sets with different no. of elements in each set. I want to compute no. of ways of choosing captain from each one of them modulo 109+7.
This means, from each set I have to chose one captain and then in how many ways captains from each set can be selected and since the no. of ways will be large I have to calculate modulo with 109+7.
what could be the most efficient way to compute this.
Thanks in advance.