2.19
https://leetcode-cn.com/problems/predict-the-winner/submissions/
预测赢家
①暴力递归
class Solution { public: bool PredictTheWinner(vector<int>& nums) { return total(nums, 0, nums.size() - 1) >= 0; } int total(vector<int>&nums,int i,int j) { if(i==j) return nums[i]; int left=nums[i]-total(nums,i+1,j); int right=nums[j]-total(nums,i,j-1); return max(left,right); } };