2315. Count Asterisks
Содержание
class Solution:
def countAsterisks(self, s: str) -> int:
res, ok = 0, 1
for c in s:
if c == "*":
res += ok
elif c == "|":
ok ^= 1
return res