We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Sherlock and Permutations
Sherlock and Permutations
Sort by
recency
|
146 Discussions
|
Please Login in order to post a comment
java solution using dynamic programming
solved as a comb def solve(n, m): return (math.factorial(n+m-1)//(math.factorial(m-1)*math.factorial(n))) % (10**9+7)
Sherlock Holmes' deductive prowess navigates the intricate permutations of mystery with unparalleled brilliance. Lotus365 com
Solution without math namespace, Python3:
I have read some codes but i still cant understand why my code return the different result. Did it reach the limit of the long type? The results are either negative numbers or 0.