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.
p is prime so by definition it cannot be the product of two smaller numbers. Both n and m are smaller than p so the factorial product will never contain p as a factor and thus will never be a multiple of p.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Matrix Tracing
You are viewing a single comment's thread. Return to all comments →
p is prime so by definition it cannot be the product of two smaller numbers. Both n and m are smaller than p so the factorial product will never contain p as a factor and thus will never be a multiple of p.