https://programmers.co.kr/learn/courses/30/lessons/12971
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int solution(vector<int> sticker)
{
int answer = 0;
int dp[100002];
if (sticker.size() == 1) return sticker[0];
dp[0] = sticker[0];
dp[1] = sticker[0];
answer = sticker[0];
for (int i = 2; i < sticker.size() - 1; i++) {
dp[i] = max(dp[i - 1], dp[i - 2] + sticker[i]);
answer = max(answer, dp[i]);
}
dp[0] = 0;
dp[1] = sticker[1];
answer = max(answer,sticker[1]);
for (int i = 2; i < sticker.size(); i++) {
dp[i] = max(dp[i - 1], dp[i - 2] + sticker[i]);
answer = max(answer, dp[i]);
}
return answer;
}