프로그래머스 문제풀러가기 프로그래밍 강의 | 프로그래머스 기초부터 차근차근, 직접 코드를 작성해 보세요. 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 탐욕법에 관..
프로그래머스 문제 풀러가기 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 내 풀이: from itertools import combinations as combi def solution(phoneBook): answer = True for (a,b) in combi( sorted(phoneBook, key= len),2): if a == b[:len(a)]: answer = False return answer 테스트 케이스는 통과했지만 효율성 측면에서 통과하지 못했습니다. 문제 풀이 과정에서 from itertools import combinations ..
- Total
- Today
- Yesterday
- greedy
- 리액트
- 라이프 사이클
- 계수정렬
- 병합정렬
- 배포
- 정렬
- 다익스트라
- stack
- EC2
- 퀵 소트
- 자동화
- RDS
- 알고리즘
- 알고스팟
- 백준
- spring boot
- 서버
- react
- 삽입정렬
- 가상환경
- ci/cd
- Union-FInd
- oauth
- 합병정렬
- 스프링 부트
- AWS
- 버블정렬
- CodeDeploy
- 선택정렬
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |