Can someone please explain me the approach to solve this problem https://www.codechef.com/PLCO2018/problems/KILLLAZ asked 18 Jan '18, 17:54

You need to arrange N numbers, and the arrangement must contain a given subsequence of length M. First of all, check if its possible, ie., if all the M numbers are distinct. Then, since the order in which the M numbers appear is fixed, we just need to find the number of ways in which you can put the other NM numbers in N positions. After that, the remaining M numbers will be placed in the leftover spaces. The number of ways in which you can put NM numbers in N positions is Np(NM) = N!/M!. answered 18 Jan '18, 18:35
If some elements in the m sized array are same then the answer would be zero right ? Else n!/m!
(18 Jan '18, 19:33)
@kunal12 Yes.
(18 Jan '18, 20:45)

Suppose you have n=4,m=2 . You can place the remaining 2 elements in 4 * 3 ways. For n=5,m=2 ,you can place the remaining 3 elements in 5 * 4 * 3 ways.Observed some pattern?Rest I'll leave it to you to know how. You can refer this Code answered 18 Jan '18, 18:44

Who to approach this one from the same contest, help please https://www.codechef.com/PLCO2018/problems/PRMSWP answered 21 Jan '18, 15:46
