Skip to content

Instantly share code, notes, and snippets.

@mareksimunek
Created August 26, 2014 14:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mareksimunek/4be9bd49305a31690803 to your computer and use it in GitHub Desktop.
Save mareksimunek/4be9bd49305a31690803 to your computer and use it in GitHub Desktop.
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