Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def adjacentElementsProduct(inputArray):
- length = len(inputArray) - 1
- x = 0
- y = 1
- product = []
- while length >= y:
- firstIndex = inputArray[x]
- secondIndex = inputArray[y]
- product.append(firstIndex*secondIndex)
- x = x + 1
- y = y + 1
- return max(product)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement