def isBeautifulString(inputString): from string import ascii_lowercase alpha_list = list(ascii_lowercase) # 비교할 알파벳 소문자 리스트 IS = list(set(inputString)) IS.sort() print(IS) IL = [] for i in range(len(IS)): total = 0 for j in range(len(inputString)): if IS[i] != alpha_list[i]: return False elif IS[i] == inputString[j]: total += 1 IL.append(total) print(IL) for k in range(len(IL)-1): if IL[k] < IL[..
def longestDigitsPrefix(inputString): MAKE = [] TEMP = list(inputString) if TEMP[0].isdigit() == True: for i in range(len(TEMP)): if TEMP[i].isdigit() == True: MAKE.append(TEMP[i]) else: return ''.join(MAKE) else: return "" return ''.join(MAKE)