<jupyter_start><jupyter_text>2021년 2월 3일 수요일 leetCode - Find the Difference (Python) 문제 : https://leetcode.com/problems/find-the-difference/ 블로그 : https://somjang.tistory.com/entry/leetCode-389-Find-the-Difference-Python  첫번째 시도<jupyter_code>from collections import Counter

class Solution:
    def findTheDifference(self, s: str, t: str) -> str:   
        cnt_s = Counter(list(s))
        cnt_t = Counter(list(t))
        
        s_keys = list(cnt_s.keys())
        
        for key in s_keys:
            cnt_t[key] = cnt_t[key] - cnt_s[key]
        
        
            
        t_items = [item[0] for item in cnt_t.items() if item[1] != 0]
        
        answer = "".join(t_items)      
        
            
        return answer<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.11573472041612484, 'fraction_numerical': 0.015604681404421327, 'mean_word_length': 2.0434782608695654, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 6, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '83300', 'license': 'MIT', 'n_tokens_mistral': 294, 'n_tokens_neox': 297, 'n_words': 53, 'path': 'DAY 301 ~ 400/DAY312_[leetCode] Find the Difference (Python).ipynb', 'repo_name': 'SOMJANG/CODINGTEST_PRACTICE', 'size': '769'}