Fix: Ensure all skills are tracked as files, not submodules
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
# HumanEval/18
|
||||
# Loki Mode Multi-Agent Solution
|
||||
# Attempts: 1
|
||||
# Passed: True
|
||||
|
||||
def how_many_times(string: str, substring: str) -> int:
|
||||
""" Find how many times a given substring can be found in the original string. Count overlaping cases.
|
||||
>>> how_many_times('', 'a')
|
||||
0
|
||||
>>> how_many_times('aaa', 'a')
|
||||
3
|
||||
>>> how_many_times('aaaa', 'aa')
|
||||
3
|
||||
"""
|
||||
if not string or not substring:
|
||||
return 0
|
||||
|
||||
count = 0
|
||||
for i in range(len(string) - len(substring) + 1):
|
||||
if string[i:i + len(substring)] == substring:
|
||||
count += 1
|
||||
|
||||
return count
|
||||
Reference in New Issue
Block a user