프로그래머스 알고리즘 문제/Level 1 (10) 썸네일형 리스트형 프로그래머스 Level 1 - 완주하지 못한 선수 내 정답: def solution(participant, completion): participant.sort() completion.sort() for i in range(len(participant)-1, -1, -1): if participant[i] == completion [i-1]: continue else: return participant[i] 다른 사람의 정답: collections 패키지 사용 import collections def solution(participant, completion): answer = collections.Counter(participant) - collections.Counter(completion) return list(answer.keys())[0] 해시.. 프로그래머스 Level 1 - 크레인 인형 뽑기 내가 제출한 정답: def solution(board, moves): answer = 0 stack = [] def checkStack(stck): length = len(stck) if length < 2: return False elif stck[length-1] == stck[length-2]: stck.pop() stck.pop() return True return False for move in moves: for row in board: if row[move-1]: stack.append(row[move-1]) row[move-1] = 0 if checkStack(stack): answer += 2 break return answer 다른 사람의 정답들: def solution(board, m.. 이전 1 2 다음