2287. Rearrange Characters to Make Target String
On This Page
class Solution:
def rearrangeCharacters(self, s: str, target: str) -> int:
cnt1 = Counter(s)
cnt2 = Counter(target)
return min(cnt1[c] // v for c, v in cnt2.items())