Calculate subset sum for positive elements
for ( int i = 0 ; i <= n - 1 ; i ++ ) { if ( arr [ i ] > 0 && hashPositive . ContainsKey ( arr [ i ] ) ) { if ( hashPositive [ arr [ i ] ] == 1 ) { SubsetSum_1 += arr [ i ] ; } } }