Skip to content

Instantly share code, notes, and snippets.

View Underdoge's full-sized avatar
🏠
Working from home

Underdoge Underdoge

🏠
Working from home
View GitHub Profile
@Underdoge
Underdoge / shapeArea.js
Last active April 7, 2021 23:13
shapeArea
function shapeArea(n) {
return 2*Math.pow(n,2) - 2*n +1;
}
@Underdoge
Underdoge / adjacentElementsProduct.js
Last active February 24, 2017 02:26
adjacentElementsProduct
function adjacentElementsProduct(inputArray) {
var i=0,x=inputArray[i]*inputArray[i+1];
i++;
while(i+1<inputArray.length){
if(inputArray[i]*inputArray[i+1]>x)
x=inputArray[i]*inputArray[i+1];
i++;
}
return x;
}