일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | ||||
4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 |
- 수학
- 딕셔너리
- 스택
- 운영체제
- MYSQL
- python
- BOJ
- BFS
- level0
- 재귀
- 프로그래머스
- DP
- 다이나믹 프로그래밍
- N과M
- 그리디
- 에라스토테네스의 체
- programmers
- 힙
- 다익스트라
- 가상메모리
- 파이썬
- level1
- level2
- level3
- 가상메모리 관리
- 구현
- dfs
- 브루트포스
- 백준
- 코딩테스트
- Today
- Total
목록코테/프로그래머스 (89)
동캄의 코딩도장
https://school.programmers.co.kr/learn/courses/30/lessons/131704def solution(order): answer = 0 # 최종 결과를 저장할 변수 (몇 개를 올바르게 꺼냈는지) convey = [i for i in range(len(order), 0, -1)] # 컨베이어 벨트에 놓인 상자들 (큰 번호부터 1까지 역순) sub_convey_ = [] # 보조 벨트 (임시로 옮긴 상자들) # 주문 순서(order)에 따라 상자를 처리 for i in range(len(order)): if convey and order[i] >= convey[-1]: # 메인 벨트에서 상자를 꺼내야 ..
https://school.programmers.co.kr/learn/courses/30/lessons/136798 프로그래머스SW개발자를 위한 평가, 교육, 채용까지 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프programmers.co.kr def solution(number, limit, power): answer = 0 # 최종 결과를 저장할 변수 # 1부터 number까지 반복 for num in range(1, number + 1): temp = 0 # num의 약수 개수를 세기 위한 변수 # 1부터 sqrt(num)까지 약수를 찾는다 for div in range(1, int(num**0.5) + 1): ..
https://school.programmers.co.kr/learn/courses/30/lessons/159994def solution(cards1, cards2, goal): answer = '' # 최종 답을 저장할 변수 ('Yes' 또는 'No') i = 0 # cards1 리스트의 현재 인덱스 j = 0 # cards2 리스트의 현재 인덱스 while True: # 계속 반복하면서 goal을 순서대로 만들어나간다 # cards1에서 다음 단어가 goal의 현재 위치 단어와 일치하면 if i 포인터를 각각 하나씩 써서 해결하면 된다.
# 프로그래머스 level2 숫자 카드 나누기 def div(num): arr=[] for i in range(1,int(num**0.5)+1): if num%i==0: arr.append(i) arr.append(num//i) return arr def solution(arrayA, arrayB): min_A=min(arrayA) min_B=min(arrayB) arr_A=div(min_A) arr_B=div(min_B) ans_A=[] ans_B=[] for ele_arr_A in arr_A: for val_A in arrayA: if val_A % ele_arr_A!=0: break else: ans_A.append(ele_arr_A) for ele_arr_B in arr_B: for val_B i..
https://school.programmers.co.kr/learn/courses/30/lessons/138477 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr #프로그래머스 level1 명예의 전당 (1) def solution(k, score): answer = [] lst=[] if k
#프로그래머스 level1 추억 점수 from collections import defaultdict def solution(name, yearning, photo): answer = [] dic=defaultdict(int) for i in range(len(name)): dic[name[i]]=yearning[i] for list_ in photo: cnt=0 for name_ in list_: cnt+=dic[name_] answer.append(cnt) return answer 딕셔너리를 이용하였다.