https://programmers.co.kr/learn/courses/30/lessons/17677
from itertools import combinations
def solution(str1, str2):
answer = 0
stack1=[]
stack2=[]
for i in range(1,len(str1)):
tmp = ''
if (str1[i].isalpha()) :
if(str1[i-1].isalpha()):
tmp = str1[i-1] + str1[i]
stack1.append(tmp.lower())
for i in range(1,len(str2)):
tmp = ''
if (str2[i].isalpha()) :
if(str2[i-1].isalpha()):
tmp = str2[i-1] + str2[i]
stack2.append(tmp.lower())
inter = []
cnt = 0
for i in stack1:
if i in stack2:
stack2.remove(i)
cnt+=1
total = len(stack1+stack2)
if total == 0:
return 65536
return int(cnt/total * 65536)