All possible numbers of N digits and base B without leading zeros | function to count all permutations ; count of all permutations ; count of permutations with leading zeros ; Return the permutations without leading zeros ; Driver code
def countPermutations ( N , B ) : NEW_LINE INDENT x = B ** N NEW_LINE y = B ** ( N - 1 ) NEW_LINE print ( x - y ) NEW_LINE DEDENT if __name__ == " _ _ main _ _ " : NEW_LINE INDENT N , B = 6 , 4 NEW_LINE countPermutations ( N , B ) NEW_LINE DEDENT