题目链接
2744. 最大字符串配对数目 - 力扣(LeetCode)
题目代码
class Solution:
def maximumNumberOfStringPairs(self, words: List[str]) -> int:
result =0
map = []
for i in words:
if i[::-1] not in map:
map.append(i)
else:
map.remove(i[::-1])
result += 1
return result