Quotes help make search much faster. Example: "Practice Makes Perfect"

Monday, May 1, 2017

Codefights Sample Solution for adjacentElementsProduct


function adjacentElementsProduct(inputArray) {
    max = -1000000;
    for(i=0; i<inputArray.length-1; i++){
        product = inputArray[i]*inputArray[i+1];
        if(product>max){
           max = product;   
        }
    }
    return max;
}

No comments:

Post a Comment


This is an example of scrolling text using Javascript.

Popular Posts