Consider a difference of 1 between elements as 0