Hi Counter

Finding a short substring is a basic skill for working with text, logs, and messages. Write a function count_hi that takes a string s and counts how many times the substring hi appears in it. Return that count as an integer.

Примеры

Ввод
"abc hi ho"
Вывод
1
Ввод
"ABChi hi"
Вывод
2
Ввод
"hihi"
Вывод
2

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

def count_hi(s: str) -> int:

Теги

strings
PostgreSQLv16

Aquí aparecerá el resultado de la ejecución del código

Visible tests
1
Input
"abc hi ho"
Expected1
2
Input
"ABChi hi"
Expected2
3
Input
"hihi"
Expected2
4
Input
"hellohi"
Expected1
5
Input
"xxhixx"
Expected1
6
Input
""
Expected0
Focus radio
Paused · SomaFM · Fluid