Skip to content

Instantly share code, notes, and snippets.

@dalejandroramirez
Created September 14, 2017 02:18
Show Gist options
  • Save dalejandroramirez/abc6d4f0f0a1145cffb90dc4ef43bc30 to your computer and use it in GitHub Desktop.
Save dalejandroramirez/abc6d4f0f0a1145cffb90dc4ef43bc30 to your computer and use it in GitHub Desktop.
Dada una matriz de números enteros, encuentre el par de elementos adyacentes que tiene el producto más grande y devuelva ese producto
def adjacentElementsProduct(inputArray):
m=[]
for i in range(len(inputArray)-1):
m.append(inputArray[i]*inputArray[i+1])
return(max(m))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment