- 博客(6)
- 收藏
- 关注
原创 Leetcode:241. Different Ways to Add Parentheses
Description解题思路本题为分治算法问题,题意为给定一串数字和操作符,进行计算,返回所有可能结果。代码如下class Solution {public: vector<int> diffWaysToCompute(string input) { vector<int> result; int size = input.size();
2018-01-09 14:36:35 212
原创 Leetcode:375. Guess Number Higher or Lower II
DescriptionWe are playing the Guess Game. The game is as follows:I pick a number from 1 to n. You have to guess which number I picked.Every time you guess wrong, I’ll tell you whether the number I pick
2018-01-09 14:15:29 282
原创 Leetcode:464. Can I Win
DescriptionIn the “100 game,” two players take turns adding, to a running total, any integer from 1..10. The player who first causes the running total to reach or exceed 100 wins.What if we change
2018-01-07 00:45:10 437
原创 Leetcode:486. Predict the Winner
DescriptionGiven an array of scores that are non-negative integers. Player 1 picks one of the numbers from either end of the array followed by the player 2 and then player 1 and so on. Each time a play
2018-01-03 13:54:06 198
原创 Leetcode:329. Longest Increasing Path in a Matrix
Description解题思路拓扑排序题,但用DFS算法更为简单class Solution {public: int DFS(vectorvectorint>>& matrix, int y, int x, int val, vectorvectorint>>& hash) { if(y 0 || y >= matrix.size() || x
2018-01-03 13:31:37 153
原创 Leetcode:210. Course Schedule II
DescriptionThere are a total of n courses you have to take, labeled from 0 to n - 1.Some courses may have prerequisites, for example to take course 0 you have to first take course 1, which is expr
2018-01-03 13:24:17 196
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人