he-018
1.000
Proposed solution
```python
def how_many_times(string: str, substring: str) -> int:
""" Find how many times a given substring can be found in the original string. Count overlapping cases.
>>> how_many_times('', 'a')
0
>>> how_many_times('aaa', 'a')
3
>>> how_many_times('aaaa', 'aa')
3
"""
count = 0
start = 0
while True:
start = string.find(substring, start) + 1
if start > 0:
count += 1
else:
return count
```Test output (stdout)
. [100%] 1 passed in 0.01s
System prompt
You are an expert programmer. Solve the task exactly as specified. Output your solution as fenced code blocks using the required file name(s) and the exact function/type signatures requested. Prefer correctness; do not include prose outside code unless asked.