Created
August 26, 2014 14:40
-
-
Save mareksimunek/4be9bd49305a31690803 to your computer and use it in GitHub Desktop.
This file contains 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
var pole = [8,7,3,6]; | |
var result =[]; | |
var count =0; | |
var offDiff=0; | |
for(var i=2; i<pole.length-1;i++){ | |
var diff = pole[i-1]- pole[i-2]; | |
var diff2 = pole[i] - pole[i-1]; | |
if(diff==diff2){ | |
if(count>2)offDiff=diff; | |
count++ | |
}else{ | |
result = | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment