string-algorithm-matcher
Match string problems to appropriate algorithms
它会碰到什么
这一栏是扫描器报的事实,不是结论。命中多不等于有毒(安全工具、规则库、示例脚本本来就会包含危险写法),命中少也不等于干净。它和你手上的凭据、文件、网络有什么关系,需要你自己看。
技能内容
String Algorithm Matcher Skill
Purpose
Match string processing problems to the most appropriate algorithms based on requirements and constraints.
Capabilities
- Pattern matching algorithm selection (KMP, Z, Rabin-Karp)
- Suffix structure selection (array vs tree vs automaton)
- Palindrome detection algorithm selection
- Rolling hash implementation guidance
- String DP technique matching
Target Processes
- pattern-matching-algorithms
- trie-suffix-structures
- string-processing
Algorithm Selection Guide
Single Pattern Matching
| Scenario | Algorithm | Complexity |
|----------|-----------|------------|
| Single pattern | KMP | O(n+m) |
| Multiple patterns | Aho-Corasick | O(n+m+z) |
| Approximate match | Rolling Hash | O(n*m) average |
Suffix Structures
| Need | Structure | Build Time |
|------|-----------|------------|
| Substring search | Suffix Array | O(n log n) |
| Multiple queries | Suffix Tree | O(n) |
| Subsequence counting | Suffix Automaton | O(n) |
Palindromes
| Problem | Algorithm |
|---------|-----------|
| Longest palindromic substring | Manacher |
| Palindrome partitioning | DP + Manacher |
| Palindrome queries | Hashing |
Input Schema
{
"type": "object",
"properties": {
"problemDescription": { "type": "string" },
"problemType": {
"type": "string",
"enum": ["patternMatch", "suffixQueries", "palindrome", "subsequence", "dp"]
},
"constraints": { "type": "object" }
},
"required": ["problemDescription"]
}
Output Schema
{
"type": "object",
"properties": {
"success": { "type": "boolean" },
"algorithm": { "type": "string" },
"complexity": { "type": "string" },
"alternatives": { "type": "array" },
"implementation": { "type": "string" }
},
"required": ["success", "algorithm"]
}想直接用这个技能?
本站把开放许可(MIT / Apache 等)的技能按仓库打包整理到网盘,点一下转存到你自己的网盘,不用一个个从 GitHub 拉。许可未声明的技能只给原始仓库链接,不打包。
它属于哪个仓库
library/specializations/algorithms-optimization/skills/string-algorithm-matcher/SKILL.md