일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 | 31 |
- greedy
- stateful
- Q objects
- AWS
- dictionary
- pytest
- SQL
- combinations
- Stack
- was
- utils
- stack&que
- algorithm
- stateless
- TDD
- HTTP 완벽 가이드
- Django
- ws
- Python
- ORM
- Bruteforce
- Gunicorn
- Query
- codecov
- permutations
- Unit Testing
- postreSQL
- Git
- Programmers
- 백준
- Today
- Total
목록stack&que (4)
해피 코딩!
link def solution(priorities, location): answer = [] lst = [i for i in range(len(priorities))] while priorities: if priorities[0] == max(priorities): answer.append(lst.pop(0)) priorities.pop(0) else: lst.append(lst.pop(0)) priorities.append(priorities.pop(0)) return answer.index(location)+1
link # 시간 초과 def solution(prices): answer = [0] * len(prices) for index, value in enumerate(prices): for indent_index, indent_value in enumerate(prices[index+1:]): if value = prices[index]: answer[index] +=1 else: answer[index] +=1 break return answer
문제 링크 def solution(bridge_length, weight, truck_weights): answer = 0 bridge = bridge_length * [0] while bridge: bridge.pop(0) answer += 1 if truck_weights: head = truck_weights[0] if sum(bridge) + head
해당 문제 링크 def solution(progresses, speeds): answer = [] while progresses: for index, value in enumerate(progresses): progresses[index] += speeds[index] cnt = 0 while progresses and progresses[0] >= 100: progresses.pop(0) speeds.pop(0) cnt += 1 if cnt: answer.append(cnt) return answer 정말 매번 고민하지만 너무 어렵게 생각하는 것 같다.. 결국 인터넷을 참고하여 문제를 풀게 되었으며 답을 보게 되면 왜 이렇게 생각을 못하였는지 항상 아쉬움이 남는다.