Advertisement
Guest User

Untitled

a guest
Dec 15th, 2018
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.32 KB | None | 0 0
  1. def adjacentElementsProduct(inputArray):
  2.     length = len(inputArray) - 1
  3.     x = 0
  4.     y = 1
  5.    
  6.     product = []
  7.     while length >= y:
  8.         firstIndex = inputArray[x]
  9.         secondIndex = inputArray[y]
  10.         product.append(firstIndex*secondIndex)
  11.         x = x + 1
  12.         y = y + 1
  13.     return max(product)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement