Click here to Skip to main content
15,917,584 members

Comments by roger.t.jefferson (Top 2 by date)

roger.t.jefferson 11-Jan-21 20:40pm View    
Customer 1 & 3 have account 10,13. This is a perfect match.

Customer 2 & 4 have account 13. But since customer 4 also has account 13, customer 2 & 4 are NOT a perfect match
roger.t.jefferson 11-Jan-21 19:48pm View    
Here is what I've tried.
First, I iterate customers to find out what accounts each customer has. I simply add the account to the set as I find it.

Customer
std::set<account>

So, once I finish the iteration, all customers have their account recorded.

I then iterate the customer again to build this map/dictionary structure

std::map<std::set<account>, std::vector<customer>>

Once this step is done, I have something like this:

key (as set<account>) value (as vector<customer>)
{10,11} {1,3}
{13} {2,4}
{14} {14}

If I use database, any suggestion or hint on what to do?