题解 | 穷哈哈~
穷哈哈~
https://www.nowcoder.com/practice/5b3184b233f34fb39a7f259ae82eb42c
n = int(input())
s = input()
max = 0
c = 0
q = None
for i in s:
if i != 'a' and i != 'h':
q = None
continue
if q is None:
c = 1
q = i
else:
if i != q:
c = c + 1
q = i
else:
c = 1
q = i
if c > max:
max = c
print(max)

网易游戏公司福利 609人发布