temp > n is checked so that pairs ( x , y ) and ( y , x ) don 't get counted twice
if ( temp > n && find ( nums . begin ( ) , nums . end ( ) , temp ) != nums . end ( ) ) { count ++ ; } } return count ; }