If sum of current pair is not in hash , then store it and continue to next pair
int sum = arr [ i ] + arr [ j ] ; if ( Hash . find ( sum ) == Hash . end ( ) ) Hash [ sum ] = make_pair ( i , j ) ; else { pair < int , int > pp = Hash [ sum ] ; cout << " ( " << arr [ pp . first ] << " , ▁ " << arr [ pp . second ] << " ) ▁ and ▁ ( " << arr [ i ] << " , ▁ " << arr [ j ] << " ) n " ; return true ; } } } cout << " No ▁ pairs ▁ found " ; return false ; }