Check if i - arr [ j ] exist in the array or not using set . If yes , Then i can be represented as sum of arr [ j ] + ( i - arr [ j ] )
if ( i - arr [ j ] ) in s and arr [ j ] != ( i - arr [ j ] ) : NEW_LINE INDENT count += 1 NEW_LINE DEDENT