mirror of
https://github.com/codeflash-ai/codeflash-internal.git
synced 2026-05-04 18:25:18 +00:00
26 lines
307 B
Python
26 lines
307 B
Python
def problem_p02939(input_data):
|
|
S = eval(input_data)
|
|
|
|
N = len(S)
|
|
|
|
ans = 0
|
|
|
|
pre = ""
|
|
|
|
now = ""
|
|
|
|
for i in range(N):
|
|
|
|
if pre == now or now == "":
|
|
|
|
now += S[i]
|
|
|
|
if pre != now:
|
|
|
|
ans += 1
|
|
|
|
pre = now
|
|
|
|
now = ""
|
|
|
|
return ans
|