I'm looking to see if built in with the math library in python is the "Permutation of multiset".
I know that this can be programmed but at the moment I not an expert in python. So I can't do sophisticated way. Is there anybody here who can?
https://en.wikipedia.org/wiki/Permutation#Permutations_of_multisets
I had a programming challenge (I am not a student but I want to improve myself), but my solution, not enough fast (many test cases mostly timed out). But the problem sounds easy: how many ways exits from top-left to bottom-right in a matrix if you can only step right and down. I do not really want to anybody solve instead of me. I just need some advice. I tried the Pascal matrix which works but slow. I think the "Permutation of multiset" is my solution because there is two types of steps D,R if my matrix MxN (1 ≤ M,N ≤ 106) that means DM-1 and RN-1 steps: n=N+M-2, m1=M-1,m2=N-1