Iterate through each number , and find the sum of proper divisors and check if it 's  also present in the array
for ( int i = 0 ; i < n ; i ++ ) { if ( s . find ( sumOfDiv ( arr [ i ] ) ) != s . end ( ) ) {