Skip to content

Instantly share code, notes, and snippets.

View gist:4be9bd49305a31690803
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++