Files
LeetCode_tasks/solutions/lc2315.py
Vombit df1dbfd0ae 4
2026-05-26 15:38:10 +05:00

15 lines
351 B
Python

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