Tara's Beautiful Permutations

  • + 0 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...