# Task
 Let's call `product(x)` the product of x's digits. Given an array of integers a, calculate `product(x)` for each x in a, and return the number of distinct results you get.

# Example

 For `a = [2, 8, 121, 42, 222, 23]`, the output should be `3`.

 Here are the products of the array's elements:
```
2: product(2) = 2;
8: product(8) = 8;
121: product(121) = 1 * 2 * 1 = 2;
42: product(42) = 4 * 2 = 8;
222: product(222) = 2 * 2 * 2 = 8;
23: product(23) = 2 * 3 = 6.```
As you can see, there are only `3` different products: `2, 6 and 8.`

# Input/Output


 - `[input]` integer array `a`

    Constraints:

    `1 ≤ a.length ≤ 10000,`

    `1 ≤ a[i] ≤ 1000000000.`


 - `[output]` an integer

    The number of different digit products in `a`.

Difficulty: introductory

Starter code:

def unique_digit_products(a):
	

Solutions:
from operator import mul
from functools import reduce


def unique_digit_products(nums):
    return len({reduce(mul, (int(a) for a in str(num))) for num in nums})


from functools import reduce
from operator import mul

def unique_digit_products(a):
    return len({reduce(mul, map(int, str(x))) for x in a})

def unique_digit_products(a):
  return len(set(eval('*'.join(str(x))) for x in a))

from functools import reduce

def product(x):
    return reduce(lambda a, b: a * b, (int(d) for d in str(x)), 1)
    
def unique_digit_products(a):
    return len({product(x) for x in a})

def digits(n):
    p = 1
    m = n
    while n:
        p *= n % 10
        n //= 10
    return m if m < 10 else p
         
def unique_digit_products(a):
    return len(set([digits(i) for i in a]))

unique_digit_products=lambda a:len({eval('*'.join(str(n)))for n in a})

unique_digit_products = lambda a, r=__import__("functools").reduce: len({r(int.__mul__, map(int, str(e))) for e in a})