From 8535ed7002aba442180dcae6d13c1d6914a435a2 Mon Sep 17 00:00:00 2001 From: Gyubin Han <89185979+Gyubin-Han@users.noreply.github.com> Date: Fri, 10 May 2024 03:39:18 +0900 Subject: [PATCH] add: boj/1439.py --- boj/1439.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 boj/1439.py diff --git a/boj/1439.py b/boj/1439.py new file mode 100644 index 0000000..25568e0 --- /dev/null +++ b/boj/1439.py @@ -0,0 +1,12 @@ +s=input() + +count=0 +last=s[0] +for i in range(1,len(s)): + if not s[i]==last: + count+=1 + last=s[i] +if count%2==1: + print(count//2+1) +else: + print(count//2)