본문 바로가기
Beakjoon&프로그래머스/파이썬

[백준/파이썬] 24510번 시간복잡도를 배운 도도

by 현장 2023. 5. 12.

-Code

res = 0

for _ in range(int(input())):
    s = input()
    cnt = s.count("for") + s.count("while")
    res = max(cnt, res)

print(res)