## Task

**_Given_** *an array of integers* , **_Find_** **_the maximum product_** *obtained from multiplying 2 adjacent numbers in the array*.
____

# Notes

* **_Array/list_** size is *at least 2*.

* **_Array/list_** numbers could be a *mixture of positives, negatives also zeroes* .
___

# Input >> Output Examples
```
adjacentElementsProduct([1, 2, 3]); ==> return 6
```

## **_Explanation_**:

* **_The maximum product_** *obtained from multiplying* ` 2 * 3 = 6 `, and **_they're adjacent numbers in the array_**.
___
```
adjacentElementsProduct([9, 5, 10, 2, 24, -1, -48]); ==> return 50
```
## **_Explanation_**:
**_Max product_** obtained *from multiplying*   ``` 5 * 10  =  50  ```.
___
```
adjacentElementsProduct([-23, 4, -5, 99, -27, 329, -2, 7, -921])  ==>  return -14
```

## **_Explanation_**:

* **_The maximum product_** *obtained from multiplying* ` -2 * 7 = -14 `, and **_they're adjacent numbers in the array_**.
___
___
___

# [Playing with Numbers Series](https://www.codewars.com/collections/playing-with-numbers)

# [Playing With Lists/Arrays Series](https://www.codewars.com/collections/playing-with-lists-slash-arrays)

# [For More Enjoyable Katas](http://www.codewars.com/users/MrZizoScream/authored)
___

## ALL translations are welcomed

## Enjoy Learning !!
# Zizou

Difficulty: EASY
Tags: Fundamentals

Data structures
Skill types: Data structures

Starter code:
def adjacent_element_product(array):
	

Solutions:
def adjacent_element_product(array):
	return max((a * b for (a, b) in zip(array, array[1:])))


def adjacent_element_product(array):
	return max((array[i] * array[i + 1] for i in range(len(array) - 1)))


def adjacent_element_product(array):
	return max((x * y for (x, y) in zip(array, array[1:])))


from operator import mul

def adjacent_element_product(array):
	return max(map(mul, array, array[1:]))


from itertools import islice

def adjacent_element_product(xs):
	return max((x * y for (x, y) in zip(xs, islice(xs, 1, None))))


def adjacent_element_product(array):
	new_list = []
	sum = 1
	for e in range(len(array)):
		if e == 0:
			sum *= array[e] * array[e + 1]
			new_list.append(sum)
			sum = 1
		elif e in range(1, len(array) - 1):
			sum *= array[e - 1] * array[e]
			new_list.append(sum)
			sum = 1
			sum *= array[e + 1] * array[e]
			new_list.append(sum)
			sum = 1
		else:
			sum *= array[e] * array[e - 1]
	return max(new_list)


def adjacent_element_product(x):
	L = []
	for i in range(len(x) - 1):
		L.append(x[i] * x[i + 1])
	return max(L)


def adjacent_element_product(array):
	products = []
	for i in range(0, len(array) - 1):
		products.append(array[i] * array[i + 1])
	return max(products)


def adjacent_element_product(arr):
	product = [arr[i] * arr[i + 1] for i in range(len(arr) - 1)]
	return max(product)


def adjacent_element_product(array):
	max = array[0] * array[1]
	for i in range(1, len(array) - 1):
		temp = array[i] * array[i + 1]
		if max < temp:
			max = temp
	return max


def adjacent_element_product(lst):
	return max((lst[i] * lst[i + 1] for i in range(len(lst) - 1)))


def adjacent_element_product(array):
	max_product = array[0] * array[1]
	i = 2
	while i < len(array):
		max_product = max(max_product, array[i - 1] * array[i])
		i += 1
	return max_product


def adjacent_element_product(arr):
	return max((arr[i] * n for (i, n) in enumerate(arr[1:])))


def adjacent_element_product(a):
	return max((x * y for (x, y) in zip(a, a[1:])))


def adjacent_element_product(xs):
	return max((xs[i - 1] * xs[i] for i in range(1, len(xs))))


def adjacent_element_product(n):
	return max([n[i] * n[i + 1] for i in range(len(n) - 1)])


adjacent_element_product = lambda array: max([a * b for (a, b) in zip(array[:-1], array[1:])])


def adjacent_element_product(array):
	return max([j * array[i + 1] for (i, j) in enumerate(array[:-1])])


adjacent_element_product = lambda arr: len(arr) and max((x * y for (x, y) in zip(arr, arr[1:])))


def adjacent_element_product(arr):
	a = arr[0] * arr[1]
	for i in range(1, len(arr)):
		if arr[i] * arr[i - 1] > a:
			a = arr[i] * arr[i - 1]
	return a


def adjacent_element_product(arr):
	s = []
	for i in range(len(arr) - 1):
		s.append(arr[i] * arr[i + 1])
	n = max(s)
	return n


def adjacent_element_product(arr):
	return sorted([arr[x] * arr[x + 1] for x in range(len(arr) - 1)], reverse=True)[0]


def adjacent_element_product(array):
	john = []
	for (i, v) in enumerate(array):
		if i == len(array) - 1:
			pass
		else:
			john.append(array[i] * array[i + 1])
	return max(john)


def adjacent_element_product(array):
	m = -10000000
	for (n, i) in enumerate(array[:-1]):
		m = max(m, i * array[n + 1])
	return m


def adjacent_element_product(array):
	list_pro = list()
	for index in range(len(array[:-1])):
		product = array[index] * array[index + 1]
		list_pro.append(product)
	return max(list_pro)


def adjacent_element_product(array):
	return max([i * l for (i, l) in zip(array, array[1:])])


def adjacent_element_product(A):
	return max([a * b for (a, b) in zip(A[:-1], A[1:])])


def adjacent_element_product(array):
	a = []
	print(array)
	for i in range(len(array)):
		a.append(array[i] * array[i - 1])
	return max(a[1:])


def adjacent_element_product(array):
	M = array[0] * array[1]
	for (i, element) in enumerate(array[1:]):
		x = element * array[i]
		if x > M:
			M = x
	return M


def adjacent_element_product(array):
	arr_max = []
	for i in range(len(array) - 1):
		arr_max.append(array[i] * array[i + 1])
	return max(arr_max)


def adjacent_element_product(array):
	new = []
	for i in range(len(array) - 1):
		numero = array[i] * array[i + 1]
		new.append(numero)
	return max(new)


def adjacent_element_product(array):
	m = None
	for i in range(1, len(array)):
		if m == None or array[i] * array[i - 1] > m:
			m = array[i] * array[i - 1]
	return m


def adjacent_element_product(a):
	b = []
	for i in range(len(a) - 1):
		c = a[i] * a[i + 1]
		b.append(c)
	return max(b)


def adjacent_element_product(array):
	maxProduct = array[0] * array[1]
	for i in range(1, len(array) - 1):
		product = array[i] * array[i + 1]
		if product > maxProduct:
			maxProduct = product
	return maxProduct


def adjacent_element_product(a):
	return max((a[x] * a[x + 1] for x in range(len(a) - 1)))


def adjacent_element_product(p):
	return max((p[i] * p[-~i] for i in range(~-len(p))))


def adjacent_element_product(array):
	length = len(array)
	res = []
	for i in range(length):
		if i < length - 1:
			res.append(array[i] * array[i + 1])
	res.sort()
	return res[-1]


def adjacent_element_product(array):
	l = array[-2] * array[-1]
	for i in range(len(array) - 2):
		l = max(l, array[i] * array[i + 1])
	return l


def adjacent_element_product(array):
	arr = []
	left_index = 0
	right_index = -len(array) + 1
	middle_index = 1
	if len(array) == 2:
		return array[0] * array[1]
	while middle_index < len(array):
		arr.append(array[left_index] * array[right_index])
		left_index += 1
		right_index += 1
		middle_index += 1
	return max(arr)


def adjacent_element_product(array):
	return max((m * n for (m, n) in zip(array, array[1:])))


def adjacent_element_product(array):
	max_product = array[0] * array[1]
	for i in range(len(array) - 1):
		subset = array[i] * array[i + 1]
		if subset > max_product:
			max_product = subset
	return max_product


def adjacent_element_product(array):
	return max((i * array[idx - 1] for (idx, i) in enumerate(array[1:], 1)))


def adjacent_element_product(array):
	return max([array[x] * array[x - 1] for x in range(1, len(array))])


def adjacent_element_product(array):
	return max(list(map(lambda x, y: x * y, array[:-1], array[1:])))


def adjacent_element_product(array):
	maximum = array[0] * array[1]
	for (n1, n2) in zip(array[1:], array[2:]):
		maximum = max(maximum, n1 * n2)
	return maximum


adjacent_element_product = lambda a: max((x * y for (x, y) in zip(a, a[1:])))


def adjacent_element_product(array):
	results_list = []
	prev = array[0]
	for element in array[1:]:
		maximum = prev * element
		prev = element
		results_list.append(maximum)
	return max(results_list)


def adjacent_element_product(array):
	new_list = []
	for x in range(len(array)):
		if x + 1 >= len(array):
			break
		else:
			new_list.append(array[x] * array[x + 1])
	return max(new_list)


def adjacent_element_product(array):
	res = array[0] * array[1]
	for i in range(2, len(array)):
		prod = array[i] * array[i - 1]
		if prod > res:
			res = prod
	return res


from itertools import starmap
from operator import mul
from typing import List

def adjacent_element_product(array: List[int]) -> int:
	return max(starmap(mul, list(zip(array, array[1:]))))


def adjacent_element_product(array):
	max = -float('inf')
	for i in range(1, len(array)):
		if array[i] * array[i - 1] > max:
			max = array[i] * array[i - 1]
	return max


adjacent_element_product = lambda lst: max((x * y for (x, y) in zip(lst, lst[1:])))


def adjacent_element_product(array):
	m = -1000000
	for i in range(len(array) - 1):
		m = max(m, array[i] * array[i + 1])
	return m


def adjacent_element_product(array):
	maxp = None
	i = 1
	while i < len(array):
		product = array[i] * array[i - 1]
		if maxp == None or product > maxp:
			maxp = product
		i = i + 1
	return maxp


def adjacent_element_product(array):
	biggest = -1000000
	i = 0
	while i < len(array) - 1:
		prod = array[i] * array[i + 1]
		if prod > biggest:
			biggest = prod
		i += 1
	return biggest


def adjacent_element_product(lst):
	return max((a * b for (a, b) in zip(lst[:-1], lst[1:])))


def adjacent_element_product(a):
	return max([a[i] * a[i + 1] for i in range(0, len(a) - 1)])


def adjacent_element_product(arr):
	return max([e1 * e2 for (e1, e2) in zip(arr[1:], arr[:-1])])


def adjacent_element_product(array):
	max_prod = array[0] * array[1]
	for i in range(1, len(array)):
		if array[i] * array[i - 1] > max_prod:
			max_prod = array[i] * array[i - 1]
	return max_prod


def adjacent_element_product(array):
	a = []
	for i in range(0, len(array)):
		for j in range(0, len(array)):
			if abs(j - i) == 1:
				p = array[i] * array[j]
				a.append(p)
	return max(a)


def adjacent_element_product(a):
	m = a[0] * a[1]
	for i in range(len(a)):
		try:
			if a[i] * a[i + 1] > m:
				m = a[i] * a[i + 1]
		except:
			return m


def adjacent_element_product(array):
	res = []
	start = array[0]
	for num in array[1:]:
		res.append(start * num)
		start = num
	return max(res)


def adjacent_element_product(array):
	return max([array[e] * array[e + 1] for e in range(len(array) - 1)])


def adjacent_element_product(arr):
	list = []
	for number in range(len(arr) - 1):
		list.append(arr[number] * arr[number + 1])
	return max(list)


def adjacent_element_product(array):
	max = -99999999999
	for (i, n) in enumerate(array):
		if i < len(array) - 1 and n * array[i + 1] > max:
			max = n * array[i + 1]
	return max


def adjacent_element_product(array):
	index1 = 0
	index2 = 0
	max1 = -9999999
	for i in range(len(array) - 1):
		if array[i] * array[i + 1] > max1:
			max1 = array[i] * array[i + 1]
			index1 = i
			index2 = i + 1
	return array[index1] * array[index2]


def adjacent_element_product(array):
	res = []
	for i in range(len(array) - 1):
		ans = array[i] * array[i + 1]
		res.append(ans)
	return max(res)


def adjacent_element_product(array):
	return max(map(lambda i: array[i] * array[i + 1], range(len(array) - 1)))


def adjacent_element_product(array):
	max_product = array[0] * array[1]
	for (index, item) in enumerate(array[1:-1]):
		next_item = array[index + 2]
		product = item * next_item
		if product > max_product:
			max_product = product
	return max_product


def adjacent_element_product(array):
	return max((k * i for (i, k) in zip(array, array[1:])))


def adjacent_element_product(array):
	return max((array[i] * array[i + 1] for (i, x) in enumerate(array[:-1])))


from operator import mul

def adjacent_element_product(a):
	return max(map(mul, a, a[1:]))


def adjacent_element_product(array):
	new_list = []
	for i in range(len(array)):
		if array[i] != array[-1]:
			new_list.append(array[i] * array[i + 1])
	new_list.sort()
	return new_list[-1]


def adjacent_element_product(array):
	i = 1
	maximum = array[0] * array[i]
	for c in array[:-1]:
		if c * array[i] > maximum:
			maximum = c * array[i]
		i += 1
	return maximum


def adjacent_element_product(array):
	mults = []
	i = 0
	while i + 1 < len(array):
		mults.append(array[i] * array[i + 1])
		i += 1
	return max(mults)


def adjacent_element_product(array):
	len_array = len(array)
	products = []
	for value in range(0, len_array - 1):
		products.append(array[value] * array[value + 1])
	products.sort()
	return products[-1]


def adjacent_element_product(array):
	i = 0
	listy = []
	while i < len(array) - 1:
		num = int(array[i]) * int(array[i + 1])
		listy.append(num)
		i += 1
	return max(listy)


def adjacent_element_product(array):
	if len(array) == 2:
		product_1 = 1
		for element in array:
			product_1 *= element
		return product_1
	elif len(array) >= 2:
		products = []
		for number in range(1, len(array)):
			product_2 = 1
			product_2 *= array[number - 1] * array[number]
			products.append(product_2)
		return max(products)


def adjacent_element_product(array):
	biggest = array[0] * array[1]
	index = 1
	while index < len(array):
		if array[index] * array[index - 1] > biggest:
			biggest = array[index] * array[index - 1]
		index += 1
	return biggest


def adjacent_element_product(array):
	num = array[0] * array[1]
	i = 1
	while i + 1 < len(array):
		if array[i] * array[i + 1] > num:
			num = array[i] * array[i + 1]
		i += 1
	return num


def adjacent_element_product(array):
	print(array)
	i = 1
	rtot = array[0] * array[1]
	while i + 1 <= len(array):
		if array[i] * array[i - 1] >= rtot:
			rtot = array[i] * array[i - 1]
			print(rtot)
		i += 1
	return rtot


def adjacent_element_product(array):
	max_prod = max([i * array[_index + 1] for (_index, i) in enumerate(array[:-1])])
	return max_prod


def adjacent_element_product(array):
	maximum = array[0] * array[1]
	for number in range(1, len(array) - 1):
		if array[number] * array[number + 1] > maximum:
			maximum = int(array[number]) * int(array[number + 1])
	return maximum


from functools import reduce

def adjacent_element_product(array):
	return max([reduce(lambda n, m: n * m, array[x:x + 2]) for x in range(len(array) - 1)])


def adjacent_element_product(array):
	maxp = float('-inf')
	for i in range(1, len(array)):
		x = array[i]
		y = array[i - 1]
		maxp = max(maxp, x * y)
	return maxp


def adjacent_element_product(array):
	res = min(array) * max(array)
	for (i, item) in enumerate(array):
		if i + 1 < len(array):
			if item * array[i + 1] >= res:
				res = item * array[i + 1]
	return res


def adjacent_element_product(array):
	a = []
	for i in range(0, len(array) - 1):
		a.append(array[i] * array[i + 1])
	a = sorted(a)
	return a[len(a) - 1]


def adjacent_element_product(array):
	maxpro = -111111111111
	p = 0
	while p < len(array) - 1:
		maxar = array[p] * array[p + 1]
		if maxar > maxpro:
			maxpro = maxar
		p = p + 1
	return maxpro


def adjacent_element_product(array):
	i = 0
	c = array[0] * array[1]
	while i < len(array) - 1:
		if array[i] * array[i + 1] > c:
			c = array[i] * array[i + 1]
		i += 1
	return c


def adjacent_element_product(array):
	i = 0
	b = 0
	c = array[0] * array[1]
	while i < len(array) - 1:
		b = array[i] * array[i + 1]
		if b > c:
			c = b
			i += 1
		else:
			i += 1
	return c


def adjacent_element_product(array):
	i = 0
	j = 1
	x = array[i] * array[i + 1]
	while i <= len(array) - 2:
		j = array[i] * array[i + 1]
		print(j)
		i += 1
		if j >= x:
			x = j
		else:
			x = x
	return x