백준 19564번: 반복 #Python

ColorlessDia·2024년 2월 14일

algorithm/baekjoon

목록 보기
81/808
S = input()
K = 1

temp = S[0]

for s in S[1:]:
    if temp[-1] < s:
        temp += s
    else:
        K += 1
        temp = s

print(K)

0개의 댓글