일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- 수학
- 다익스트라
- BFS
- 재귀
- N과M
- 가상메모리
- level2
- dfs
- DP
- 힙
- python
- 가상메모리 관리
- programmers
- 구현
- 백준
- 그리디
- 코딩테스트
- level3
- 에라스토테네스의 체
- 스택
- BOJ
- level1
- 다이나믹 프로그래밍
- 프로그래머스
- 브루트포스
- 파이썬
- 딕셔너리
- MYSQL
- level0
- 운영체제
- Today
- Total
목록코테/프로그래머스 level0 (16)
동캄의 코딩도장
https://school.programmers.co.kr/learn/courses/30/lessons/120956 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr def solution(babbling): answer = 0 for babb in babbling: babb = list(map(str, babb)) i = 0 length = len(babb) while i < length: if babb[i] == 'a' and (i+2 < length) and babb[i+1] == 'y' and babb[i+2] == 'a': i += 3 elif ba..
https://school.programmers.co.kr/learn/courses/30/lessons/120921?language=python3 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr def solution(A, B): answer = 0 check=0 length= len(A) for i in range(length): if (A==B): check=1 break a=A[-1] A=A[:-1] A=a+A answer+=1 if check!=1: answer=-1 return answer 같지 않으면, 맨 끝 알파벳을 따로 저장하고, 맨 앞에 붙..
https://school.programmers.co.kr/learn/courses/30/lessons/120871 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr #프로그래머스 저주의 숫자 3 def solution(n): answer = 0 num=1 while True: if not (num%3==0 or ('3' in str(num))): n-=1 if n==0: break num+=1 answer=num return answer 간단히 해결할 수 있는 문제이다. 숫자가 작아서 제일 쉬운 방법으로 해결하였다.
https://school.programmers.co.kr/learn/courses/30/lessons/120880 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr #프로그래머스 특이한 정렬 def solution(numlist, n): answer = [] numlist.sort(key=lambda x: (abs(n-x),(-x))) answer=list(map(int,numlist)) return answer 파이썬 내장 함수를 이용하면 문제를 쉽게 해결할 수 있다. 하지만, 코딩 연습인 만큼 내장함수를 최대한 이용하지 않고 문제를 해결해보면... #프..
https://school.programmers.co.kr/learn/courses/30/lessons/120863 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr #프로그래머스 다항식 더하기 def solution(polynomial): x_cnt=0 digit=0 arr=list(map(str,polynomial.split())) for val in arr: if val!='+': if 'x' in val: if len(val)==1: x_cnt+=1 else: x_cnt+=int(val[:-1]) else: digit+=int(val) if x_cnt..
https://school.programmers.co.kr/learn/courses/30/lessons/120812 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr #파이썬 최빈값 구하기 import collections def solution(array): answer=collections.Counter(array).most_common(2) if len(answer)==1: answer=answer[0][0] elif answer[0][1]==answer[1][1]: answer=-1 else: answer=answer[0][0] return answe..