https://programmers.co.kr/learn/courses/30/lessons/60057#
def solution(s):
answer = len(s)
for j in range(1, len(s)//2+1):
array = []
# 문자열 슬라이싱 하기
for i in range(0, len(s), j):
start = i
end = i+j
array.append(s[start: end])
# 압축 길이 계산 시작
index = 0
while index < len(array)-1:
if array[index] == array[index+1]:
array.pop(index+1)
if type(array[index-1]) is not int:
array.insert(index, 2)
else:
array[index-1] += 1
index -= 1
index += 1
# 길이 연산
array = list(map(str, array))
array = "".join(array)
if answer > len(array):
answer = len(array)
return answer