[ SW Expert Academy ] 1954. 달팽이 숫자
아.. 나선형 문제 분명 풀어봤는데.. 한 큐에 못 풀었다.. 쏘쌛.. 그래도 한 번 해봤다고 힌트 슬쩍 보고 바로 구현 가능했다. 다음에 비슷한 문제 나오면 맞추길🙏 T = int(input()) # 여러개의 테스트 케이스가 주어지므로, 각각을 처리합니다. dx = [0, 1, 0, -1] dy = [1, 0, -1, 0] for test_case in range(1, T + 1): # /////////////////////////////////////////////////////////////////////////////////// n = int(input()) snail = [[0] * n for _ in range(n)] x, y = 0, 0 direction = 0 for k in range(1..
[ 프로그래머스 ] 성격 유형 검사하기
풀이 소요 시간 18분 생각보다 깔끔하게 풀렸다. def solution(survey, choices): answer = '' dict = {'R': 0, 'T': 0, 'C': 0, 'F': 0, 'J': 0, 'M': 0, 'A': 0, 'N': 0} for char, choi in zip(survey, choices): a, b = char[0], char[1] if choi 4: dict[b] += (choi - 4) for i in range(4): a = list(dict.items())[2*i] b = list(dict.items())[2*i+1] if a[1] ..