- 博客(4)
- 资源 (1)
- 收藏
- 关注
原创 leetcode764+最大的十字架Dp
https://leetcode.com/problems/largest-plus-sign/ class Solution { public: int orderOfLargestPlusSign(int N, vector<vector<int>>& mines) { int res = 0, cnt = 0; ve...
2019-01-19 22:43:31 322
原创 leetcode763+贪心。map记录每个字符最右边的位置
https://leetcode.com/problems/partition-labels/ class Solution { public: vector<int> partitionLabels(string S) { map<char, int> d; for(int i=0; i<S.size(); i++){ ...
2019-01-18 00:32:34 195
原创 leetcode724+找出一串数字数组的中间索引,使得左右两边相等。数值叠加sum
https://leetcode.com/problems/find-pivot-index/ //sums[i]表示当前i索引之前所有值的和,不包括i //sums[n] - sums[i + 1]表示当前索引i之后所有值的和。索引n之前就是所有的元素之和 class Solution { public: int pivotIndex(vector<int>& n...
2019-01-17 22:47:54 537
原创 leetcode766+判断每一个元素的左上角是否和自己相等
https://leetcode.com/problems/toeplitz-matrix/ //判断每个值是否等于左上角值 class Solution { public: bool isToeplitzMatrix(vector<vector<int>>& matrix) { int row = matrix.size(), col ...
2019-01-13 22:04:09 105
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人