It's like house robber , no need [0/1]
\nclass Solution {\npublic:\n    long long maximumTotalCost(vector<int>& nums) {\n        int n = nums.size();\n        vector<long long>dp(n + 1);\n        dp[
```\nclass Solution {\npublic:\n    long long maximumTotalCost(vector<int>& nums) {\n        int n = nums.size();\n        vector<long long>dp(n + 1);\n        dp[0] = 0;\n        dp[1] = nums[0];\n        for(int i = 1; i < n; i ++)\n            dp[i + 1] = max(dp[i] + nums[i], dp[i - 1] + nums[i - 1] - nums[i]);\n        return dp[n];\n    }\n};\n```
['C++']