You are given number of places as m and number of digits as n. You have to fill those m places in such a way that each digit appears at least one time.
For example
Given m as 4 and n as 3 so you have 4 places and 3 digits. Now For this total possible number of combinations are 36.
Lets take a simple example:
m=3 and n=2(a,b suppose) then possible combinations are
aba aab abb bab bba baa
Thus 6 combinations are possible only. Is there Any Formula for this because I am required to find the possible number of combinations?