다트게임
-
[프로그래머스 Python] 다트게임 (from kakao)Algorithm/1일 1코테 2020. 10. 14. 16:36
문제 programmers.co.kr/learn/courses/30/lessons/17682 코딩테스트 연습 - [1차] 다트 게임 programmers.co.kr 나의 풀이 def solution(dartResult): dart = list(dartResult) #한자리씩 list로 생성 score = [] #변환한 거 저장해줄 리스트 # 문자열 -> 리스트 처리 for i in range(len(dart)): if dart[i] == '1' and dart[i+1] == '0': # 10 처리 score.append('10') elif dart[i] == '0' and dart[i-1] == '1': # 겹치면 pass continue else: score.append(dart[i]) # 나머지는 그..