You will be given the prime factors of a number as an array.
E.g: ```[2,2,2,3,3,5,5,13]```

You need to find the number, n, to which that prime factorization belongs.
It will be:
```
n = 2³.3².5².13 = 23400
```
Then, generate the divisors of this number.

Your function ```get_num() or getNum()``` will receive an array with potentially unordered prime factors and should output: an array with the found integer n at index 0, the amount of total divisors (both prime and compound numbers) at index 1, followed the smallest factor (index 2, and the biggest one (last element)

We will see the example given above with the only difference that the array of the prime factors is unordered.

The list of divisors for that number (23400) is:
```
2, 3, 4, 5, 6, 8, 9, 10, 12, 13, 15, 18, 20, 24, 25, 26, 30, 36, 39, 40, 45, 50, 52, 60, 65, 72, 75, 78, 90, 100, 104, 117, 120, 130, 150, 156, 180, 195, 200, 225, 234, 260, 300, 312, 325, 360, 390, 450, 468, 520, 585, 600, 650, 780, 900, 936, 975, 1170, 1300, 1560, 1800, 1950, 2340, 2600, 2925, 3900, 4680, 5850, 7800, 11700 (not considering the integer 23400 itself)
```
There is a total amount of ```71``` divisors. The smallest divisor is ```2``` and the highest ```11700```.
So the expected output will be: 
```
get_num([2,13,2,5,2,5,3,3]) == [23400, 71, 2, 11700]
```
Enjoy!

Source: codewars | Difficulty: EASY
Tags: Fundamentals

Data structures

Mathematics

Starter code: def get_num(arr):
	

Solutions:
def get_num(arr):
	(c, n, r) = (1, 1, {})
	arr.sort()
	for a in arr:
		n *= a
		r[a] = r[a] + 1 if a in r else 1
	for a in r:
		c *= r[a] + 1
	return [n, c - 1, arr[0], n // arr[0]]


from collections import Counter
from functools import reduce
from operator import mul

def get_num(arr):
	(n, small) = (reduce(mul, arr), min(arr))
	count = reduce(mul, (v + 1 for v in Counter(arr).values())) - 1
	return [n, count, small, n // small]


import itertools
import functools
import operator

def get_num(arr):
	arr.sort()
	counter = 0
	for i in range(1, len(arr) + 1):
		combu = set(itertools.combinations(arr, i))
		counter += len(combu)
	minik = min(arr)
	number = functools.reduce(operator.mul, arr)
	biggest = number / minik
	return [number, counter, minik, biggest]


from functools import reduce
from operator import mul

def get_num(a):
	a.sort()
	m = reduce(mul, [i ** a.count(i) for i in set(a)])
	total_d = reduce(mul, [a.count(i) + 1 for i in set(a)])
	return [m, total_d - 1, a[0], m // a[0]]


import itertools

def get_num(arr):
	n = 1
	amount = 1
	div = []
	for i in arr:
		n = n * i
		if i not in div:
			amount = amount * (arr.count(i) + 1)
			div.append(i)
	lil_div = min(arr)
	big_div = n // lil_div
	return [n, amount - 1, lil_div, big_div]


def get_num(arr):
	if len(arr) == 0:
		return []
	res = 1
	smallest = arr[0]
	divisors = {}
	for val in arr:
		res *= val
		if val < smallest:
			smallest = val
		if val not in divisors:
			divisors[val] = 0
		divisors[val] += 1
	num_divisors = 1
	for val in divisors:
		num_divisors *= divisors[val] + 1
	return [res, num_divisors - 1, smallest, res // smallest]


from collections import Counter
from functools import reduce
from operator import mul

def get_num(arr):
	c = Counter(arr)
	x = reduce(mul, arr)
	d = reduce(mul, [v + 1 for v in c.values()]) - 1
	return [x, d, min(arr), x // min(arr)]