'' Take adjacent difference  of same values
for i in range ( 1 , len ( vec ) ) : NEW_LINE INDENT res = min ( res , abs ( vec [ i ] - vec [ i - 1 ] ) ) NEW_LINE DEDENT if ( i ) : NEW_LINE INDENT a = vals [ i ] NEW_LINE DEDENT