Check for every k - consecutive digits using sliding window
for j in range ( K , N ) : NEW_LINE INDENT if ( sum - digits [ j - K ] + digits [ j ] != sum ) : NEW_LINE INDENT flag = 1 ; NEW_LINE break ; NEW_LINE DEDENT DEDENT if ( flag == 0 ) : NEW_LINE INDENT count += 1 ; NEW_LINE DEDENT return count ; NEW_LINE