牛客159707358号
牛客159707358号
全部文章
分类
归档
标签
去牛客网
登录
/
注册
牛客159707358号的博客
TA的专栏
40篇文章
0人订阅
剑指offer回顾
40篇文章
116人学习
全部文章
(共99篇)
题解 | 二叉树中和为某一值的路径(三)
/** * struct TreeNode { * int val; * struct TreeNode *left; * struct TreeNode *right; * TreeNode(int x) : val(x), left(nullptr), right(nullptr) {...
2025-03-03
0
78
题解 | 在二叉树中找到两个节点的最近公共祖先 用栈保留顺序
/** * struct TreeNode { * int val; * struct TreeNode *left; * struct TreeNode *right; * TreeNode(int x) : val(x), left(nullptr), right(nullptr) {...
2025-03-03
0
64
题解 | 礼物的最大价值 !!
class Solution { public: int maxValue(vector<vector<int> >& grid) { int m = grid.size(); int n = grid[0].size();...
2025-03-03
0
65
题解 | 字符串的排列
class Solution { public: /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * * @param str string字符串 * @return string字符串vecto...
2025-03-03
0
58
题解 | 字符串的排列
#include <string> #include <vector> class Solution { public: /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * * @pa...
2025-03-03
0
50
题解 | 字符串的排列
#include <string> #include <vector> class Solution { public: /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * * @pa...
2025-03-03
0
56
题解 | 删除链表中重复的结点
/* struct ListNode { int val; struct ListNode *next; ListNode(int x) : val(x), next(NULL) { } }; */ class Solution { public: ...
2025-03-03
0
76
题解 | 整数中1出现的次数(从1到n整数中1出现的次数)
class Solution { public: int count_1(int v) { int count=0; while(v) { if(v%10==1) { ...
2025-03-02
0
90
题解 | 丑数 求下个丑数->求下一个为*2/*3/*5的丑数的位置
#include <cmath> class Solution { public: /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * * @param index int整型 * @...
2025-03-02
0
47
题解 | 求1+2+3+...+n 短路规则代替if
class Solution { public: int Sum_Solution(int n) { //通过与运算判断n是否为正数,以结束递归 n && (n += Sum_Solution(n - 1)); return ...
2025-03-02
0
50
首页
上一页
1
2
3
4
5
6
7
8
9
10
下一页
末页