[알고리즘] 프로그래머스 | 신규 아이디 추천
제목+링크 답: 더보기 import re def solution(new_id): text = new_id text = text.lower() text = re.sub('[^a-z\d\-\_\.]', '', text) text = re.sub('\.\.+', '.', text) text = re.sub('^\.|\.$', '', text) if text == "": text = "a" text = re.sub('^\.|\.$', '', text[:15]) while len(text) < 3: text += text[-1:] return text 약간의 리팩터링 import re def solution(new_id): text = new_id text = re.sub('[^a-z\d\-\_\.]', '', ..
2023. 8. 17.