Function to return the total number of M length words which have at least a single character repeated more than once
def countWords ( N , M ) : NEW_LINE INDENT return pow ( N , M ) - nPr ( N , M ) ; NEW_LINE DEDENT