MCPcopy Create free account
hub / github.com/Vishruth-S/CompetitiveCode / Solution

Class Solution

LeetCode_problems/Find_the_Difference/solution.py:2–9  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1from collections import Counter
2class Solution:
3 def findTheDifference(self, s: str, t: str) -> str:
4 cts=Counter(s)
5 ctt=Counter(t)
6 for i in ctt.keys():
7 if ctt[i]>cts[i]:
8 return i
9 return ""
10# make a frequency map of both the strings
11# iterate over keys of string t
12# check if value of that key is bigger than the value of

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected