add nd target in a array with neighbor elements difference absolute value equals 1 problem