Flexible Code Match

Sometimes you need to search for a pattern instead of an exact word, where one character can be anything. Write a function count_code that takes a string s and counts every substring in the form co + any character + e. For example, code, coze, and cope all count.

Примеры

Ввод
"aaacodebbb"
Вывод
1
Ввод
"codexxcode"
Вывод
2
Ввод
"cozexxcope"
Вывод
2

Нужно реализовать

def count_code(s: str) -> int:

Теги

strings
PostgreSQLv16

Tady se objeví výsledek běhu kódu

Visible tests
1
Input
"aaacodebbb"
Expected1
2
Input
"codexxcode"
Expected2
3
Input
"cozexxcope"
Expected2
4
Input
"xxcope"
Expected1
5
Input
"cope"
Expected1
6
Input
"code"
Expected1
Focus radio
Paused · SomaFM · Fluid