4
This commit is contained in:
14
solutions/lc2315.py
Normal file
14
solutions/lc2315.py
Normal file
@@ -0,0 +1,14 @@
|
||||
class Solution:
|
||||
def countAsterisks(self, s: str) -> int:
|
||||
is_count = True
|
||||
n = 0
|
||||
for i in s:
|
||||
if i == '|' and is_count == False:
|
||||
is_count = True
|
||||
elif i == '|' and is_count:
|
||||
is_count = False
|
||||
|
||||
if i == '*' and is_count:
|
||||
n += 1
|
||||
|
||||
return n
|
||||
Reference in New Issue
Block a user