일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- MYSQL
- 딕셔너리
- 구현
- 다이나믹 프로그래밍
- 수학
- level1
- 가상메모리 관리
- 백준
- 코딩테스트
- 가상메모리
- dict
- programmers
- DP
- level0
- 다익스트라
- 그리디
- N과M
- 힙
- dfs
- level3
- 브루트포스
- 스택
- 운영체제
- 프로그래머스
- 재귀
- BFS
- python
- BOJ
- 파이썬
- level2
- Today
- Total
목록level2 (47)
동캄의 코딩도장
https://programmers.co.kr/learn/courses/30/lessons/12985 코딩테스트 연습 - 예상 대진표 △△ 게임대회가 개최되었습니다. 이 대회는 N명이 참가하고, 토너먼트 형식으로 진행됩니다. N명의 참가자는 각각 1부터 N번을 차례대로 배정받습니다. 그리고, 1번↔2번, 3번↔4번, ... , N-1번↔N programmers.co.kr #프로그래머스 예상 대진표 def solution(n,a,b): answer = 0 a-=1 b-=1 while a!=b: a//=2 b//=2 answer+=1 return answer a와 b를 1씩 빼고, 같아 질 때 까지 나눈다. (같아지면 만나므로)
https://programmers.co.kr/learn/courses/30/lessons/12981 코딩테스트 연습 - 영어 끝말잇기 3 ["tank", "kick", "know", "wheel", "land", "dream", "mother", "robot", "tank"] [3,3] 5 ["hello", "observe", "effect", "take", "either", "recognize", "encourage", "ensure", "establish", "hang", "gather", "refer", "reference", "estimate", "executive"] [0,0] programmers.co.kr #프로그래머스 영어 끝말잇기 def solution(n, words): lst=[] ..
https://programmers.co.kr/learn/courses/30/lessons/84512 코딩테스트 연습 - 모음사전 사전에 알파벳 모음 'A', 'E', 'I', 'O', 'U'만을 사용하여 만들 수 있는, 길이 5 이하의 모든 단어가 수록되어 있습니다. 사전에서 첫 번째 단어는 "A"이고, 그다음은 "AA"이며, 마지막 단어는 "UUUUU"입니 programmers.co.kr #프로그래머스 모음사전 def solution(word): import sys sys.setrecursionlimit(10**6) vowels=['A','E','I','O','U'] global cnt global answer answer = 0 cnt=0 string='' def dfs(w): global cnt ..
https://programmers.co.kr/learn/courses/30/lessons/42584 코딩테스트 연습 - 주식가격 초 단위로 기록된 주식가격이 담긴 배열 prices가 매개변수로 주어질 때, 가격이 떨어지지 않은 기간은 몇 초인지를 return 하도록 solution 함수를 완성하세요. 제한사항 prices의 각 가격은 1 이상 10,00 programmers.co.kr #프로그래머스 주식가격 def solution(prices): answer = [0]*(len(prices)) lst=[] for i in range (len(prices)): lst.append([i,prices[i]]) stack=[] for i in range(len(prices)): if stack: k=price..
https://programmers.co.kr/learn/courses/30/lessons/76502 코딩테스트 연습 - 괄호 회전하기 programmers.co.kr #프로그래머스 괄호 회전하기 다른사람풀이 def solution(s): answer = 0 temp = list(s) for _ in range(len(s)): st = [] for i in range(len(temp)): if len(st) > 0: if st[-1] == '[' and temp[i] == ']': st.pop() elif st[-1] == '(' and temp[i] == ')': st.pop() elif st[-1] == '{' and temp[i] == '}': st.pop() else: st.append(temp[..
https://programmers.co.kr/learn/courses/30/lessons/12973 코딩테스트 연습 - 짝지어 제거하기 짝지어 제거하기는, 알파벳 소문자로 이루어진 문자열을 가지고 시작합니다. 먼저 문자열에서 같은 알파벳이 2개 붙어 있는 짝을 찾습니다. 그다음, 그 둘을 제거한 뒤, 앞뒤로 문자열을 이어 붙 programmers.co.kr #짝지어 제거하기 def solution(s): i=0 lst=[] for i in range(len(s)): lst.append(s[i]) if len(lst)>1: if lst[-2]==lst[-1]: lst.pop() lst.pop() if lst: return 0 else: return 1 스택에 담아서 같은것이 있으면 pop 해준다. 반복문..