300x250 commonCharacterCount1 Codesignal - commonCharacterCount Given two strings, find the number of common characters between them. Example For s1 = "aabcc" and s2 = "adcaa", the output should be commonCharacterCount(s1, s2) = 3. Strings have 3 common characters - 2 "a"s and 1 "c". 설명 s1과 s2의 문자열을 분석하여 똑같은 문자의 개수를 구한다. 풀이 s1의 "aabcc"에 a가 2개, s2의 "adcaa"에도 a가 3개 => count에 2 s1의 "aabcc"에 c가 2개, s2의 "adcaa"에 c가 한개 => count에 1 총합 2+1 3을 리턴한다. func commonCharac.. 2021. 5. 1. 이전 1 다음 300x250