Repeat above for each character in str1 (checking to see if it exists in str2), then repeat for each character in str2 (checking to see if it exists in str1).
There is only one subtle problem -- to build used1, you will find all the common characters twice -- once during the first loop and once during the second.
thanks for the quick reply, however I won't know what str1 is so can i pass to hw.find the index of str1 iterating through the string for beginning to end.
for (int i=0; i < str1.size(); ++i);
if ( hw.find(str1[i]) )
etc
not sure if that is clear or not