👾(Lv.01)문자열 나누기
https://school.programmers.co.kr/learn/courses/30/lessons/140108
def solution(s):
answer = 0
i = 0
while i < len(s):
x = s[i] #새로운 알파벳이 기준
count_x = 0
count_not_x = 0
#같은 문자열과 다른 문자열 횟수가 같아지만 안의 루프 탈출
while i < len(s) and (count_x == 0 or count_x != count_not_x):
if s[i] == x:
count_x += 1
else:
count_not_x += 1
i += 1
answer += 1
return answer