In this Kata, you will be given a multi-dimensional array containing `2 or more` sub-arrays of integers. Your task is to find the maximum product that can be formed by taking any one element from each sub-array.

```
Examples:
solve( [[1, 2],[3, 4]] ) = 8. The max product is given by 2 * 4
solve( [[10,-15],[-1,-3]] ) = 45, given by (-15) * (-3)
solve( [[1,-1],[2,3],[10,-100]] ) = 300, given by (-1) * 3 * (-100)
```

More examples in test cases. Good luck!

Difficulty: introductory

Starter code:

def solve(arr):
	

Solutions:
def solve(arr):
    
    p, q = 1, 1
    
    for k in arr:
        
        x, y = max(k), min(k)
        
        a = p * x
        b = q * x
        c = p * y
        d = q * y
        
        p = max(a, b, c, d)
        q = min(a, b, c, d)
            
    return max(p, q)

def solve(arr):
    result = arr[0]
    for number_array in range(1, len(arr)):
        result = [x * y for x in result for y in arr[number_array]]
    return max(result)


def solve(arr, cur = [1]):
  return solve(arr[1:], [x*y for x in cur for y in arr[0]]) if arr else max(cur)

from itertools import product
from functools import reduce

def solve(arr):
    return max( reduce(int.__mul__, p,1) for p in product(*arr) )

from itertools import product
from functools import reduce
from operator  import mul

def solve(A):
    return max(map(lambda g: reduce(mul, g, 1), product(*A)))

from functools import reduce
def solve(arr):
    f = lambda x, y: [i*j for i in x for j in y]
    return max(reduce(f, arr))
    
    


from itertools import product
from functools import reduce

def solve(arr):
    return max(reduce(lambda m, n: m * n, prod) for prod in product(*arr))

from functools import reduce
from itertools import product
from operator import mul

def solve(arr):
    xss = [[min(a), max(a)] for a in arr]
    return max(reduce(mul, xs) for xs in product(*xss))

def solve(arr, cur = []):
  return (solve(arr[1:], [x*y for x in cur for y in arr[0]]) if cur else solve(arr[1:], arr[0])) if arr else max(cur)

def solve(a):
    r_min = r_max = 1
    for x in a:
        cur = [n * m for n in [min(x), max(x)] for m in [r_min, r_max]]
        r_min = min(cur)
        r_max = max(cur)
    return r_max