일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- 코딩테스트
- 라이브템플릿
- 파이썬
- BFS
- Greedy
- javascript
- HTTP
- Dijkstra
- 알고리즘
- brute force
- error
- 소수
- 탐욕법
- 백준
- 2981
- applicationeventpublisher
- Python
- 문자열
- java
- 프로그래머스
- springboot
- 최단경로
- counting elements
- 2018 KAKAO BLIND RECRUITMENT
- beandefinitionstoreexception
- Spring
- codility
- API
- spring security
- algorithm
Archives
- Today
- Total
목록time complexity (1)
Altiora Petamus

TapeEquilibrium coding task - Learn to Code - Codility Minimize the value |(A[0] + ... + A[P-1]) - (A[P] + ... + A[N-1])|. app.codility.com 🤔생각해보기 문제 그대로 단순히 배열을 slice 하는 방식으로 풀었더니 시간복잡도 문제라 그런지 점수가 아주 짜게 나왔다. 그래서 Dynamic programming 으로 풀어보았다. 합을 저장해가는 배열을 만들어둔다. 그 배열에서 하나씩 꺼내서 연산을 진행하면, 다시 처음부터 합을 구할 필요가 없다. 첫번째 풀이 - Total score 61% def solution(A): result = 0 dp = [0] * (len(A) - 1) dp[0] = A[..
1day-1algorithm
2021. 7. 1. 20:28