class Solution:
def countAndSay(self, n: int) -> str:
if n == 1:
return "1"
i = 1
num_str = str(1)
point = 0
while i < n:
new_str = ""
point = 0
for j in range(len(num_str)):
if j< (len(num_str)-1) and num_str[j + 1] == num_str[j]: # 应当考虑最后的处理,在最后考虑,以及开头的第一个
# new_str += str(len(num_str[point: j + 1])) + num_str[point]
continue
new_str += str(len(num_str[point: j + 1])) + num_str[point] # 这个对于最后没有影响,要考虑当前如果是最后要怎么办
point = j + 1
# new_str += str(len(num_str[point: len(num_str)-1])) + num_str[point]
num_str = new_str
i += 1
return new_str