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.
Probably the stack is having an overflow. And also the num can get very big. Eg 500! is like greater than 10^1000. And integers can handle numbers till 10^9.
Also, you have to return the answer in the form of ans % 10^9 + 7
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Sherlock and Permutations
You are viewing a single comment's thread. Return to all comments →
Probably the stack is having an overflow. And also the num can get very big. Eg 500! is like greater than 10^1000. And integers can handle numbers till 10^9.
Also, you have to return the answer in the form of ans % 10^9 + 7