Given a certain number, how many multiples of three could you obtain with its digits?
Suposse that you have the number 362. The numbers that can be generated from it are:
```
362 ----> 3, 6, 2, 36, 63, 62, 26, 32, 23, 236, 263, 326, 362, 623, 632 
```
But only:
```3, 6, 36, 63``` are multiple of three.
We need a function that can receive a number ann may output in the following order:
- the amount of multiples
- the maximum multiple
Let's see a case the number has a the digit 0 and repeated digits:
```
6063 ----> 0, 3, 6, 30, 36, 60, 63, 66, 306, 360, 366, 603, 606, 630, 636, 660, 663, 3066, 3606, 3660, 6036, 6063, 6306, 6360, 6603, 6630
```
In this case the multiples of three will be all except 0
```
6063 ----> 3, 6, 30, 36, 60, 63, 66, 306, 360, 366, 603, 606, 630, 636, 660, 663, 3066, 3606, 3660, 6036, 6063, 6306, 6360, 6603, 6630
```
The cases above for the function:
```python
find_mult_3(362) == [4, 63]
find_mult_3(6063) == [25, 6630]
```
In Javascript ```findMult_3()```.
The function will receive only positive integers (num > 0), and you don't have to worry for validating the entries.
Features of the random tests:
```
Number of test = 100
1000 ≤ num ≤ 100000000
```
Enjoy it!!
from functools import reduce

# get a len = 10 array with occurrences of digits
def num_to_arr(num):
    s = str(num)
    arr = [0] * 10
    for c in s:
        arr[int(c)] += 1
    return arr

# get an array of distinctive digits in an array as above
def dist_digits(arr):
    dist = []
    for i in range(0,10):
        if arr[i] > 0:
            dist.append(i)
    return dist

# get all combos given number of digits (m) and an array as above
def all_combos(arr, m):
    combos = []
    if m == 1:
        for i in range(1,10):
            if arr[i] > 0:
                combos.append([i])
        return combos

    if m > sum(arr):
        return []

    digits = dist_digits(arr)
    for d in digits:
        nextArr = [0] * 10
        for i in range(0,10):
            if i == d:
                nextArr[i] = arr[i] - 1
            if i > d:
                nextArr[i] = arr[i]
        nextCombos = all_combos(nextArr, m - 1)
        for nextComb in nextCombos:
            nextComb.append(d)
        combos.extend(nextCombos)
    return combos

# now give all combos with all possible numbers of digits that % 3 == 0
def complete_combos(arr):
    combos = []
    for i in range(1, len(arr)):
        combos.extend(all_combos(arr,i))
    return list([arr for arr in combos if sum(arr) % 3 == 0])

def fact(n, zeros = 0):
    if n == 0: return 1
    if n == 1: return 1
    return (n - zeros) * fact(n - 1)

def permus(combo):
    arr = [0] * 10
    for digit in combo:
        arr[digit] += 1
    duplicates = 1
    for i in range(0,10):
        if arr[i] > 1:
            duplicates *= fact(arr[i])
    return fact(len(combo), zeros = arr[0]) // duplicates

def find_mult_3(num):
    # your code here
    comp_combos = complete_combos(num_to_arr(num))
    return [sum(map(permus,comp_combos)), reduce(lambda x,y: x * 10 + y, comp_combos[-1])]

from functools import reduce

# get a len = 10 array with occurrences of digits
def num_to_arr(num):
    s = str(num)
    arr = [0] * 10
    for c in s:
        arr[int(c)] += 1
    return arr

# get an array of distinctive digits in an array as above
def dist_digits(arr):
    dist = []
    for i in range(0,10):
        if arr[i] > 0:
            dist.append(i)
    return dist

# get all combos given number of digits (m) and an array as above
def all_combos(arr, m):
    combos = []
    if m == 1:
        for i in range(1,10):
            if arr[i] > 0:
                combos.append([i])
        return combos

    if m > sum(arr):
        return []

    digits = dist_digits(arr)
    for d in digits:
        nextArr = [0] * 10
        for i in range(0,10):
            if i == d:
                nextArr[i] = arr[i] - 1
            if i > d:
                nextArr[i] = arr[i]
        nextCombos = all_combos(nextArr, m - 1)
        for nextComb in nextCombos:
            nextComb.append(d)
        combos.extend(nextCombos)
    return combos

# now give all combos with all possible numbers of digits that % 3 == 0
def complete_combos(arr):
    combos = []
    for i in range(1, len(arr)):
        combos.extend(all_combos(arr,i))
    return list([arr for arr in combos if sum(arr) % 3 == 0])

def fact(n, zeros = 0):
    if n == 0: return 1
    if n == 1: return 1
    return (n - zeros) * fact(n - 1)

def permus(combo):
    arr = [0] * 10
    for digit in combo:
        arr[digit] += 1
    duplicates = 1
    for i in range(0,10):
        if arr[i] > 1:
            duplicates *= fact(arr[i])
    return fact(len(combo), zeros = arr[0]) // duplicates

def find_mult_3(num):
    # your code here
    comp_combos = complete_combos(num_to_arr(num))
    return [sum(map(permus,comp_combos)), reduce(lambda x,y: x * 10 + y, comp_combos[-1])]
