z_algorithm
Compute a string's Z-array or find pattern matches in linear time, using an optional pattern to search the input text.
Instructions
Compute the Z-array for a string, or find pattern matches using the Z-algorithm in linear time.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"text": "<text>"
},
"name": "z_algorithm"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| text | Yes | Input text | |
| pattern | No | Optional pattern to search for |