Counting Perfect Subsequences

  • + 1 comment

    Can someone please tell me in layman terms, why do we do power of (MOD-2) for calculating inverse function for n?

    #define MOD 1000000007
    
    long long InverseFunc(ll n){
      return pow(n,MOD-2);   
    }