프로그래머스 문제풀러가기 프로그래밍 강의 | 프로그래머스 기초부터 차근차근, 직접 코드를 작성해 보세요. 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
- RDS
- greedy
- 삽입정렬
- ci/cd
- 알고리즘
- 리액트
- 자동화
- spring boot
- oauth
- 가상환경
- 합병정렬
- 스프링 부트
- stack
- 버블정렬
- 라이프 사이클
- 백준
- 병합정렬
- 계수정렬
- AWS
- 정렬
- 알고스팟
- 다익스트라
- 서버
- 선택정렬
- CodeDeploy
- Union-FInd
- EC2
- 배포
- react
- 퀵 소트
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |