DEV Community

Discussion on: unordered_map: vector< string > as key

Collapse
 
fenbf profile image
Bartlomiej Filipek

Hi! what's the example use case for such container? can you merge vec into a single long string?

Collapse
 
vardangrigoryan profile image
Vardan • Edited

Thanks for the comment!. The use case was to keep unique permutations of some set and then compare them pairwise or something like that. I like the idea of a long string, I'll try to apply it.

Collapse
 
fenbf profile image
Bartlomiej Filipek

so rather than storing a full set you can store ids for the permutation like a vector of idsr: 1, 2, 3, 4, 5: and then another vector with 5, 4, 1, 2, 3... etc.

Thread Thread
 
vardangrigoryan profile image
Vardan

Good idea, thanks!

Thread Thread
 
fenbf profile image
Bartlomiej Filipek

happy to see results, if that's faster and how :)