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.
@ma5termind I am trying to understand your tutorial. I had to revisit counting, permutation and combination concepts so I kinda understood the explanation part.
Regarding the code part: I'm guessing "inv[i]" means (1/F[i]); where F[i] is the factorial. So, inverse factorial. However, I don't understand how (F[i] ^ (10^9 + 5)) will invert it... or is it a trick for integers (4 bytes).
Edit: If anyone else sees this, then also let me know...
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Tara's Beautiful Permutations
You are viewing a single comment's thread. Return to all comments →
@ma5termind I am trying to understand your tutorial. I had to revisit counting, permutation and combination concepts so I kinda understood the explanation part.
Regarding the code part: I'm guessing "inv[i]" means (1/F[i]); where F[i] is the factorial. So, inverse factorial. However, I don't understand how (F[i] ^ (10^9 + 5)) will invert it... or is it a trick for integers (4 bytes). Edit: If anyone else sees this, then also let me know...