문제출처 : https://programmers.co.kr/learn/courses/30/lessons/17677
접근법
코드
def group(s):
s1 = []
for i in range(len(s)-1):
if( s[i].isalpha() and s[i+1].isalpha() ):
s1.append( (s[i]+s[i+1]).lower() )
return s1
def solution(str1, str2):
answer = 0
s1 = group(str1)
s2 = group(str2)
count = 0
for word in s1:
if( word in s2 ):
count += 1
s2.remove(word)
return 65536 if not s1 and not s2 else int( 65536 * (count/len(s1+s2)) )