觉醒火龙果很想五点下课
觉醒火龙果很想五点下课
全部文章
分类
归档
标签
去牛客网
登录
/
注册
觉醒火龙果很想五点下课的博客
全部文章
(共127篇)
题解 | 字符串的全部子序列
#include <vector> class Solution { public: set<string> ans; //采用集合的方式,自动去掉重复的元素; string temp = ""; vector<stri...
2025-05-30
0
51
题解 | 字符串的排列
#include <type_traits> class Solution { //和全排列一样的思路 public: vector<string> ans; vector<string> Permutation(string str) { ...
2025-05-29
0
45
题解 | 二叉搜索树的第k个节点
/** * struct TreeNode { * int val; * struct TreeNode *left; * struct TreeNode *right; * TreeNode(int x) : val(x), left(nullptr), right(nullptr) {...
2025-05-29
0
46
题解 | 二叉搜索树的第k个节点
/** * struct TreeNode { * int val; * struct TreeNode *left; * struct TreeNode *right; * TreeNode(int x) : val(x), left(nullptr), right(nullptr) {...
2025-05-29
0
47
题解 | 单词搜索
class Solution { public: vector<vector<int>> direction = {{0, -1},{-1, 0},{0, +1},{+1, 0} }; //左上右下 vector<vector<int>&g...
2025-05-28
0
31
题解 | 加起来和为目标值的组合(四)
class Solution { //题目限制很少,可以重复且排列不同也算,那么每一层递归时,数组全部需要检测, public: int ans = 0; int combination(vector<int>& nums, int target) { ...
2025-05-28
0
41
题解 | 没有重复项数字的全排列
#include <vector> class Solution { //全排列:给定一组不重复的元素,求出它们所有可能的排列方式(即所有顺序的组合),通过交换的方式确定一位的数字,因为交换过去的数字任然需要,如果是组合问题则尝试过的数字不再使用; public: ve...
2025-05-28
0
39
题解 | 有重复项数字的全排列
class Solution { public: vector<vector<int>> ans; vector<int> temp; vector<int> used; vector<vector<int&...
2025-05-27
0
36
题解 | 矩形覆盖
class Solution { //题目说得大矩阵是2*n的,小矩阵是2*1;然后多少种改变,可以发现其改变拆分成很多个的两个小矩阵的改变(倒一下),改变方式相同,只是位置不同,所以可以分改变的个数不同情况讨论,同时往下加个数,递归计算; public: int res=1; ...
2025-05-27
0
39
题解 | 矩形覆盖
class Solution { //题目说得大矩阵是2*n的,小矩阵是2*1;然后多少种改变,可以发现其改变拆分成很多个的两个小矩阵的改变(倒一下),改变方式相同,只是位置不同,所以可以分改变的个数不同情况讨论,同时往下加个数,递归计算; public: int res=1; ...
2025-05-27
0
41
首页
上一页
3
4
5
6
7
8
9
10
11
12
下一页
末页