MCPcopy Create free account
hub / github.com/Rohit91singh9/Coding-DP-DSA / countSharedChars

Method countSharedChars

findNumWaysToSplit.py:35–40  ·  view source on GitHub ↗
(arr1, arr2)

Source from the content-addressed store, hash-verified

33class Solution:
34 def numSplits(self, s: str, k: int) -> int:
35 def countSharedChars(arr1, arr2):
36 ans = 0
37 for i in range(26):
38 if arr1[i] > 0 and arr2[i] > 0:
39 ans += 1
40 return ans
41
42 def pos(char):
43 return ord(char) - ord('a')

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected