Sum of all numbers that can be formed with permutations of n digits
Given n distinct digits (from 0 to 9), find sum of all n digit numbers that can be formed using these digits. It is assumed that numbers formed with leading 0 are allowed. Example: Input: 1 2 3 Output: 1332 Explanation Numbers Formed: 123 , 132 , 312 , 213, 231 , 321 123 + 132 + 312 + 213 + 231 + 32