perilla
perilla
全部文章
分类
题解(3)
归档
标签
去牛客网
登录
/
注册
perilla的博客
全部文章
(共3篇)
题解 | #验证回文字符串(二)#
class Solution { public: bool palindrome2(string str, int left, int right) { /* 对删除元素后的字符串进行判断 因为前面已经判断了,所以多设置left和right两个参数 避免重复判断前面,...
C++
2022-04-24
1
446
题解 | #链表中倒数最后k个结点#
/** struct ListNode { int val; struct ListNode *next; ListNode(int x) : val(x), next(nullptr) {} }; */ class Solution { public: /** * 代码中的类名、方法名、参数...
C++
2022-04-03
0
375
题解 | #回文数字#
class Solution { public: /* * * @param x int整型 * @return bool布尔型 */ bool isPalindrome(int x) { // write code here //x为负数或者10的倍数时不是回文数字 ...
C++
2022-03-28
0
291