C# 代码
public class Solution {
public int MaximumNumberOfStringPairs(string[] words) {
HashSet<string> set = new HashSet<string>();
int result = 0;
foreach (string word in words){
if (set.Contains(word)){
result++;
}
else{
set.Add(new string(word.Reverse().ToArray()));
}
}
return result;
}
}