You are given 10 types of cards. Every card has a specific number written on it from 0 to 9 There are K cards for each number. You have a total of 10K cards.
Task:
Select N cards from the provided 10*K cards and determine the number of different sets of N cards that can be generated.
The size of these sets must be N if the order of the cards of the cards is different in two sets, then these sets are considered equal.
The size of these sets must be N if the order of the cards is different in two sets, then these sets are considered output.
Print answer modulo 10^9+7
Example:
Input:
K=1 , N=2
Output:
45
Brute force solution wasn't passing. Can anyone provide a optimized solution?