feat: 初步兼容生成内容检查

This commit is contained in:
CaIon
2024-03-20 19:00:51 +08:00
parent 7a663d26ec
commit 64b9d3b58c
21 changed files with 141 additions and 63 deletions

View File

@@ -36,3 +36,15 @@ func SundaySearch(text string, pattern string) bool {
}
return false // 如果没有找到匹配,返回-1
}
func RemoveDuplicate(s []string) []string {
result := make([]string, 0, len(s))
temp := map[string]struct{}{}
for _, item := range s {
if _, ok := temp[item]; !ok {
temp[item] = struct{}{}
result = append(result, item)
}
}
return result
}