프로그래머스

[코딩테스트] 프로그래머스 안전지대 파이썬(Python)
https://school.programmers.co.kr/learn/courses/30/lessons/120866 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr def solution(board): b = [] n = len(board) dx = [0, 0, -1, 1, -1, 1, -1, 1] dy = [1, -1, 0, 0, 1, 1, -1, -1] count = 0 for i in range(n): for j in range(n): if board[i][j] == 1: b.append((i, j)) for x, y in b: for i in ran..

[코딩테스트] 프로그래머스 평행 파이썬(Python)
https://school.programmers.co.kr/learn/courses/30/lessons/120875 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr def solution(dots): dic = {} for i in range(len(dots)): for j in range(i+1, len(dots)): x = dots[i][0] - dots[j][0] y = dots[i][1] - dots[j][1] if x == 0: dic[x] = dic.get(x, 0) + 1 else: dic[y / x] = dic.get(y / x, 0) + 1..

[코딩테스트] 프로그래머스 옹알이(1) 파이썬(Python)
https://school.programmers.co.kr/learn/courses/30/lessons/120956 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr from itertools import permutations def solution(babbling): word = ['aya', 'ye','woo','ma'] words = set() for i in range(1, 5): for lst in permutations(word, i): words.add(''.join(lst)) result= 0 for b in babbling: if b in ..