I need help on something I have string variables curWord & typeWord and matching I want to check if typeWord is having letters matching with curWord, but if typeWord has any letter which is repeating then I want to check if curWord also has that word repeating then I want that letter to be added in matching variable twice but if letter is repeating in typeWord only and curWord has it only once then I want to add it to matching only once.
for example:
Example: 1
curWord = green
typeWord = omega
then matching will be = ge
Example: 2
curWord = green
typeWord = dreed
then matching will be = ree
Example: 3
curWord = great
typeWord = dreed
then matching will be = re