Count N | Function to find the number of arrays following the given condition ; Initialize answer ; Calculate nPm ; Print ans ; Driver Code ; Given N and M ; Function Call
def noOfArraysPossible ( N , M ) : NEW_LINE INDENT ans = 1 NEW_LINE for i in range ( N ) : NEW_LINE INDENT ans = ans * ( M - i ) NEW_LINE DEDENT print ( ans ) NEW_LINE DEDENT if __name__ == " _ _ main _ _ " : NEW_LINE INDENT N = 2 NEW_LINE M = 3 NEW_LINE noOfArraysPossible ( N , M ) NEW_LINE DEDENT