Notice
Recent Posts
Recent Comments
Link
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 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
- 백준
- python
- 격파르타 합격후기
- 알고리즘
- 프로그래머스
- 코딩테스트
- 파이썬
- 격파르타 장점
- 매칭점수
- [sqld]자격증합격
- 피보나치 함수
- Find the nearest clone
- Max Array Sum
- DFS: Connected Cell in a Grid
- Roads and Libraries
- Common Child
- 격파르타 후기
- 구슬탈출2
- Recursion: Davis' Staircase
- candies
- Reverse Shuffle Merge
- programmers
- 야근지수
- 해커랭크
- Algorithm
- 머신러닝
- hackerrank
- BFS: Shortest Reach in a Graph
- Interview Preparation Kit
- Special String Again
Archives
- Today
- Total
목록Max Array Sum (1)
Archive
https://www.hackerrank.com/challenges/max-array-sum/problem Max Array Sum | HackerRank Find the maximum sum of elements in an array. www.hackerrank.com 풀이 입력으로 정수로 구성된 arr를 받을 때, 이웃하지 않은 element와의 최대합을 구하는 문제 n1, n2, n3 3개만 있고 swap해가면서 정답을 구할 수 있음. 보통 dp[i] = i번째 원소까지 봤을 때 최대합 으로 생각해 문제를 접근 n2를 초기화할 때 arr[1]로 하지 말고 max(2번째 원소까지) 음수 값도 존재하기 때문에, i번째 원소가 최대인 경우도 있음. max 값을 update할 때 자기 자신이 최대인 경우도..
공부/Algorithm
2020. 8. 31. 21:08