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
- 알고리즘
- Recursion: Davis' Staircase
- 피보나치 함수
- 머신러닝
- python
- Special String Again
- 파이썬
- Roads and Libraries
- 격파르타 후기
- Find the nearest clone
- BFS: Shortest Reach in a Graph
- 프로그래머스
- programmers
- 구슬탈출2
- candies
- 해커랭크
- 코딩테스트
- hackerrank
- 백준
- 격파르타 합격후기
- 매칭점수
- Max Array Sum
- Interview Preparation Kit
- DFS: Connected Cell in a Grid
- 격파르타 장점
- 야근지수
- Reverse Shuffle Merge
- Algorithm
- [sqld]자격증합격
- Common Child
Archives
- Today
- Total
목록Max Array Sum (1)
Archive
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/QxUcp/btqHJqCNaDL/1Z7MANbdB6loRKjodFPkik/img.png)
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