我是嫩叠
我是嫩叠
全部文章
分类
归档
标签
去牛客网
登录
/
注册
我是嫩叠的博客
全部文章
(共22篇)
题解 | #链表中倒数最后k个结点#基于vcetor
/** * struct ListNode { * int val; * struct ListNode *next; * ListNode(int x) : val(x), next(nullptr) {} * }; */ class Solution { public: ...
2024-10-02
0
111
题解 | #合并两个排序的链表#双指针交替运行
/** * struct ListNode { * int val; * struct ListNode *next; * ListNode(int x) : val(x), next(nullptr) {} * }; */ class Solution { public: ...
2024-10-02
0
86
题解 | #空格替换#基于insert和erase函数
class Replacement { public: string replaceSpace(string iniString, int length) { string s = "%20"; for (int i = 0; i &l...
2024-10-02
0
97
#填充每个节点指向最右节点的next指针 #基于queue
/** * Definition for binary tree with next pointer. * struct TreeLinkNode { * int val; * TreeLinkNode *left, *right, *next; * TreeLinkNode(int...
2024-10-01
0
71
#填充每个节点指向最右节点的next指针#基于vector
/** * Definition for binary tree with next pointer. * struct TreeLinkNode { * int val; * TreeLinkNode *left, *right, *next; * TreeLinkNode(int...
2024-10-01
0
77
题解 | #二叉树层序遍历 ii#先层序遍历,再倒置即可
/** * struct TreeNode { * int val; * struct TreeNode *left; * struct TreeNode *right; * }; */ class Solution { public: /** * * @...
2024-09-30
0
89
将各个连续段长度获取出来,输出最大值即可
#include <algorithm> #include <climits> class Solution { public: /** * * @param num int整型vector * @return int整型 ...
2024-09-30
1
92
题解 | #出现一次的数字ii#哈希表
class Solution { public: /** * * @param A int整型一维数组 * @param n int A数组长度 * @return int整型 */ int singleNumber(int* A...
2024-09-30
0
83
#判断链表中是否有环#和上一题一样,把返回值改一下就行
/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {} ...
2024-09-30
0
70
题解 | #链表中环的入口结点#每到达一个返回去扫描一遍即可
/* struct ListNode { int val; struct ListNode *next; ListNode(int x) : val(x), next(NULL) { } }; */ class Solution { public: ...
2024-09-30
0
60
首页
上一页
1
2
3
下一页
末页