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 |
Tags
- DFS: Connected Cell in a Grid
- 매칭점수
- 구슬탈출2
- python
- Max Array Sum
- candies
- Roads and Libraries
- [sqld]자격증합격
- Common Child
- Algorithm
- Recursion: Davis' Staircase
- Interview Preparation Kit
- programmers
- Special String Again
- BFS: Shortest Reach in a Graph
- 백준
- 야근지수
- 코딩테스트
- 피보나치 함수
- 파이썬
- 격파르타 장점
- 머신러닝
- 해커랭크
- 격파르타 합격후기
- 격파르타 후기
- 프로그래머스
- 알고리즘
- Find the nearest clone
- hackerrank
- Reverse Shuffle Merge
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