Multiplying res with modular inverse of X0 ! , X1 ! , . . , X9 !
for i in range ( 10 ) : NEW_LINE INDENT if ( arr [ i ] > 1 ) : NEW_LINE INDENT res = ( res * modInverse ( fact [ arr [ i ] ] , P ) ) % P ; NEW_LINE DEDENT DEDENT return res ; NEW_LINE