Created
September 14, 2017 02:18
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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