Given a pair of non-empty strings. Count the number of matching characters in those strings

preview_player
Показать описание
Given a pair of non-empty strings. Count the number of matching characters in those strings (consider the single count for the character which have duplicates in the strings).
Examples:

Input : strl = 'abodef
str2 = 'defghia'
Output : 4
(i.e. matching characters :- a, d, e, f)

Input : strI = 'aabeddeklli2@'
Output : 5
(i.e. matching characters :- b, 1, 2, @, k)
Рекомендации по теме
welcome to shbcf.ru