vault backup: 2023-11-30 09:05:07
This commit is contained in:
parent
f6b0111241
commit
9409d1dad5
@ -13,12 +13,13 @@ def search(x: str, s:str) -> int:
|
||||
@params s (str): the string
|
||||
@return: (int): the number of occurences
|
||||
"""
|
||||
i = 1
|
||||
n = len(s)
|
||||
for loop in range(n):
|
||||
if s[n] == x:
|
||||
i += 1
|
||||
return i
|
||||
i = 0
|
||||
pos = -1
|
||||
while i < len(s) and pos == -1:
|
||||
if s[i] == c:
|
||||
pos = i
|
||||
i += 1
|
||||
return pos
|
||||
|
||||
def search2(s: str, x: str) -> int:
|
||||
"""
|
||||
|
Loading…
x
Reference in New Issue
Block a user