All combinations of a string - PrismoSkills
If there are 'n' elements and we have to choose 'r' from them (assuming each element's quantity is unlimited),then each element can be chosen 'n' times, so 'r' elements can be chosen in nxnx ... n = nr times.
Read full article from All combinations of a string - PrismoSkills