15,917,584 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
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?