-
compare duplicate
Code:
column 1 column 2
test happy
check program
run place
bat bat
heart bat
if you have the data above and you wanted to check and see if a string in column 2 appears in column 1. How would
I go about doing this without checking for the same string twice?
As you see column 2 has bat listed twice, how do you perform this check only once without checking for bat again?
-
so in my program just loop through and search for the duplicates and remove them? could you give an example thanks.
-
An easy way to not have to consider duplicates would be to store your two groups of data into a set container. If you create a couple set<string> containers and try to insert the same value into the same container then that operation will fail. In the end of all your insert operations, your two set objects will only have unique entries.
-