Base Conditions
if ( N == 1 ) return 1 ; if ( N < 3 ) return 0 ; if ( N == 3 ) { int cnt = 0 ; cnt += ( abs ( arr [ 0 ] - arr [ 1 ] ) == K ? 1 : 0 ) + ( abs ( arr [ 2 ] - arr [ 1 ] ) == K ? 1 : 0 ) + ( abs ( arr [ 0 ] - arr [ 2 ] ) == K ? 1 : 0 ) ; return cnt ; }