Traverse the array
while ( end - start > 1 ) : NEW_LINE INDENT if ( arr [ start ] + arr [ end ] <= K ) : NEW_LINE INDENT start += 1 NEW_LINE DEDENT else : NEW_LINE INDENT res += 1 NEW_LINE end -= 1 NEW_LINE DEDENT DEDENT