프로그래머스 문제풀러가기 프로그래밍 강의 | 프로그래머스 기초부터 차근차근, 직접 코드를 작성해 보세요. programmers.co.kr import collections def solution(people, limit): answer = 0 _people = collections.deque(sorted(people)) while _people and _people[-1] > limit - 40: #무게 넘는 사람 탈출 answer += 1 _people.pop() while _people: light = _people.popleft() if not _people: answer += 1 while _people: heavy = _people.pop() if light + heavy
문제풀러가기 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 내 풀이 def solution(n, lost, reserve): answer = n loster = [] for l in lost: if l in reserve: reserve.remove(l) else: loster.append(l) for l in loster: if (l-1) in reserve: reserve.remove(l-1) elif (l+1) in reserve: reserve.remove(l+1) else: answer = answer - 1 return answer 탐욕법에 관..
- Total
- Today
- Yesterday
- 백준
- 선택정렬
- 계수정렬
- 정렬
- ci/cd
- AWS
- 합병정렬
- Union-FInd
- 퀵 소트
- 버블정렬
- 스프링 부트
- 배포
- 알고스팟
- CodeDeploy
- 서버
- 리액트
- oauth
- stack
- greedy
- 다익스트라
- 병합정렬
- react
- 가상환경
- 삽입정렬
- 알고리즘
- RDS
- EC2
- spring boot
- 자동화
- 라이프 사이클
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |