牛客632115956号
牛客632115956号
全部文章
分类
归档
标签
去牛客网
登录
/
注册
牛客632115956号的博客
全部文章
(共32篇)
题解 | #删除链表的节点#
/** * struct ListNode { * int val; * struct ListNode *next; * ListNode(int x) : val(x), next(nullptr) {} * }; */ class Solution { public: /*...
2023-01-22
0
223
位运算 | #二进制中1的个数#
class Solution { public: int NumberOf1(int n) { int res = 0; for (int i=0; i<32; i++){ if ((n & (1<<i)) !...
2023-01-04
0
239
动态规划 | #剪绳子#
class Solution { public: int cutRope(int number) { if (number <= 3) return number-1; vector<int> dp(number+1, 0); ...
2023-01-02
0
232
题解 | #机器人的运动范围#
class Solution { public: int res = 0; int cal(int n){ int sum = 0; while(n){ sum += (n%10); n/=10; ...
2023-01-02
0
291
回溯 | #矩阵中的路径#
class Solution { public: /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * * @param matrix char字符型vector<vector<>> ...
2023-01-02
0
265
双指针二分查找 | #旋转数组的最小数字#
class Solution { public: int minNumberInRotateArray(vector<int> rotateArray) { int n = rotateArray.size(); int l = 0, r = ...
2023-01-01
0
223
题解 | #用两个栈实现队列#
class Solution { public: void push(int node) { while (!stack2.empty()){ stack1.push(stack2.top()); stack2.pop(); ...
2023-01-01
0
245
题解 | #二叉树的下一个结点#
/* struct TreeLinkNode { int val; struct TreeLinkNode *left; struct TreeLinkNode *right; struct TreeLinkNode *next; TreeLinkNode(i...
2023-01-01
0
268
题解 | #重建二叉树#
/** * Definition for binary tree * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x),...
2022-12-31
0
233
题解 | #从尾到头打印链表#
/** * struct ListNode { * int val; * struct ListNode *next; * ListNode(int x) : * val(x), next(NULL) { * } *...
2022-12-30
0
210
首页
上一页
1
2
3
4
下一页
末页