摘要: class Solution { public: vector<int> spiralOrder(vector<vector<int>>& matrix) { vector<int> res; int t = 0; int b = matrix.size()-1; int l = 0; int r 阅读全文
posted @ 2021-08-13 20:38 三一一一317 阅读(103) 评论(0) 推荐(0)
摘要: class Solution { public: int leastBricks(vector<vector<int>>& wall) { unordered_map<int,int> un_map; if(wall.size()==0) return 0; for(int i = 0; i < w 阅读全文
posted @ 2021-08-13 20:13 三一一一317 阅读(63) 评论(0) 推荐(0)
摘要: 参考: https://leetcode-cn.com/problems/combination-sum-ii/solution/hui-su-suan-fa-jian-zhi-python-dai-ma-java-dai-m-3/ class Solution { public: vector<v 阅读全文
posted @ 2021-08-13 17:43 三一一一317 阅读(36) 评论(0) 推荐(0)
摘要: class Solution { public: vector<vector<int>> res; vector<vector<int>> permuteUnique(vector<int>& nums) { vector<int> temp; for(int i = 0; i < nums.siz 阅读全文
posted @ 2021-08-13 16:14 三一一一317 阅读(44) 评论(0) 推荐(0)
摘要: /** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode() : val(0), left(nullptr), rig 阅读全文
posted @ 2021-08-13 13:39 三一一一317 阅读(19) 评论(0) 推荐(0)
摘要: 思想很重要 class Solution { public: void solve(vector<vector<char>>& board) { int m = board.size(); int n = board[0].size(); // 从边缘开始,因为四周肯定不被包围,和四周O联通的先调用 阅读全文
posted @ 2021-08-13 12:04 三一一一317 阅读(38) 评论(0) 推荐(0)