leetcode312】的更多相关文章

Given n balloons, indexed from 0 to n-1. Each balloon is painted with a number on it represented by array nums. You are asked to burst all the balloons. If the you burst balloon i you will get nums[left] * nums[i] * nums[right] coins. Here left and r…
class Solution { public int maxCoins(int[] iNums) { int[] nums = new int[iNums.length + 2]; int n = 1; for (int x : iNums) if (x > 0) nums[n++] = x; nums[0] = nums[n++] = 1; int[][] dp = new int[n][n]; for (int k = 2; k < n; ++k) for (int left = 0;…
Given n balloons, indexed from 0 to n-1. Each balloon is painted with a number on it represented by array nums. You are asked to burst all the balloons. If the you burst balloon i you will get nums[left] * nums[i] * nums[right] coins. Here left and r…
动态规划 time O class Solution { public: int maxCoins(vector<int>& nums) { nums.insert(nums.begin(),); nums.push_back(); int n=nums.size(); vector<vector<int> > dp(n,vector<int>(n)); //按i到j的len来进行打表 ;len<n;len++){ ;i<n-len;i+…
a:excellent几乎一次ac或只有点小bug很快解决:半年后再重刷: b:经过艰难的debug和磕磕绊绊或者看了小提示才刷出来: c:经过艰难的debug没做出来,看答案刷的: 艾宾浩斯遗忘曲线数列:1,2,4,7,15,31 当天做的题目为0,将标注1 2 4 7 的题目做一遍,每天 1(new)+4(review) leetcodexxxx xxxxxx 12)leetcode30 串联所有单词的子串(hard,)c0 11) leetcode25 K 个一组翻转链表(hard,链表)…
leetcode312: https://leetcode.com/problems/burst-balloons/#/description Given n balloons, indexed from 0 to n-1. Each balloon is painted with a number on it represented by array nums. You are asked to burst all the balloons. If the you burst balloon …