2025-08-21 16:38:20 +0300 MSK
Find Maximum Number of String Pairs
Links
Code
class Solution:
def maximumNumberOfStringPairs(self, words: List[str]) -> int:
enc = set()
res = 0
for word in words:
if word in enc:
res += 1
else:
enc.add(word[::-1])
return res