E-COM-NET
首页
在线工具
Layui镜像站
SUI文档
联系我们
推荐频道
Java
PHP
C++
C
C#
Python
Ruby
go语言
Scala
Servlet
Vue
MySQL
NoSQL
Redis
CSS
Oracle
SQL Server
DB2
HBase
Http
HTML5
Spring
Ajax
Jquery
JavaScript
Json
XML
NodeJs
mybatis
Hibernate
算法
设计模式
shell
数据结构
大数据
JS
消息中间件
正则表达式
Tomcat
SQL
Nginx
Shiro
Maven
Linux
palindrome
力扣 2697. 字典序最小回文串
题目来源:https://leetcode.cn/problems/lexicographically-smallest-
palindrome
/C++题解:从两端往中间判断,不同时则用字典序小的替换字典序大的
江湖人称贺行风
·
2025-03-16 14:29
开始C++吧
leetcode
算法
c++
(LeetCode 每日一题) 1328. 破坏回文串(字符串、贪心)
C++版本:classSolution{public:stringbreak
Palindrome
(string
palindrome
){intn=
palindrome
.size();//字符串长度为1时,
岁忧
·
2025-03-10 09:05
LeetCode
java版刷题
leetcode
算法
职场和发展
java
c++
【Leetcode日常签到-1328】
时间2025年2月8日每日学习学习目标:回文字符串题目练习:leetcode1328.破坏回文串题目:由小写英文字母组成的回文字符串
palindrome
,请你将其中一个字符用任意小写英文字母替换,使得结果字符串的字典序最小
人保牛马
·
2025-03-10 08:58
算法
leetcode
1745. 分割回文串 IV
1745.分割回文串IV题目链接:1745.分割回文串IV代码如下://参考链接:https://leetcode.cn/problems/
palindrome
-partitioning-iv/solutions
咔咔咔的
·
2025-03-08 10:28
leetcode
c++
Leetcode1328:破坏回文串
题目描述:给你一个由小写英文字母组成的回文字符串
palindrome
,请你将其中一个字符用任意小写英文字母替换,使得结果字符串的字典序最小,且不是回文串。请你返回结果字符串。
ʚ发什么呆^ɞ
·
2025-03-05 17:07
python
leetcode
算法
python3
字符串
516.最长回文子序列
classSolution:deflongest
Palindrome
Subseq(self,s:str)->int:dp=[[0]*len(s)foriinrange(len(s))]foriinrange
程序员正在诞生中
·
2025-03-05 16:28
代码随想录打卡
蓝桥杯刷题
算法
python
leetcode
职场和发展
数据结构
动态规划
蓝桥杯
leetcode 9. 回文数
classSolution{public:boolis
Palindrome
(intx){if(x2147483647){returnfalse;}else{y=y*10;y+=x%10;x/=10;}}
lyx142606
·
2025-02-22 01:57
#
leetcode.1
--
100
算法
数据结构
LeetCode详解之如何一步步优化到最佳解法:9. 回文数
解法1:暴力解法代码:classSolution:defis
Palindrome
(self,x:int)->bool:corresponding_str=str(x)length=len(corr
杰瑞学AI
·
2025-02-19 08:11
LeetCode
职业发展
代码优化
leetcode
算法
职场和发展
面试
改行学it
数据结构
学习方法
Leetcode热题100题 5.最长回文子串 Java实现
示例2:输入:s="cbbd"输出:"bb"暴力解法:时间复杂度O(n*n);publicStringlongest
Palindrome
(Strings){intlen=s.length();Stringans
wenxiang99
·
2025-02-06 02:36
leetcode
leetcode
算法
LEETCODE#234回文链表
1.前半段链表元素进栈,找到中间节点后边比较边出栈boolis
Palindrome
(ListNode*head){if(head==NULL||head->next==NULL)//特殊处理returntrue
Azanulbizar
·
2025-01-27 09:36
LEETCODE
AtCoder备赛刷题 ABC 363 | Avoid
Palindrome
2
学习C++从娃娃抓起!记录下AtCoder(日本算法竞技网站)备赛学习过程中的题目,记录每一个瞬间。附上汇总贴:AtCoder备赛刷题|汇总【ProblemStatement】YouaregivenastringSSSoflengthNNNconsistingonlyoflowercaseEnglishletters.给定一个长度为NNN的字符串SSS,仅由小写英文字母组成。Findthenumb
热爱编程的通信人
·
2025-01-24 12:59
c++
算法
最长回文字串的多种解法(java)
代码如下:publicStringlongest
Palindrome
(Strings)
心 -
·
2025-01-18 19:39
java
C++ | Leetcode C++题解之第409题最长回文串
题目:题解:classSolution{public:intlongest
Palindrome
(strings){unordered_mapcount;intans=0;for(charc:s)++count
Ddddddd_158
·
2024-09-16 09:13
经验分享
C++
Leetcode
题解
Codeforces Round 972 (Div. 2) A-C 题解
本来以为B2难度会1900什么的,结果感觉1200还没有,先做的B1,后悔了QwQ关于我现场没切出C这件事……现场排名:A.Simple
Palindrome
题意构造一个长度为nnn的字符串,只包含aeiou
AKDreamer_HeXY
·
2024-09-16 00:46
Codeforces
比赛题解
c++
算法
动态规划
数据结构
贪心算法
【百日算法计划】:每日一题,见证成长(013)
输入:head=[1,2,2,1]输出:true思路找到中间节点反转后半部分链表前后链表顺序比对publicbooleanis
Palindrome
2(ListNodehead){if(head==null
码上一元
·
2024-09-14 04:23
数据结构与算法
算法
每日一题 东方博宜(1942 - 回文质数 Prime
Palindrome
s)
题目描述因为151既是一个质数又是一个回文数(从左到右和从右到左是看一样的),所以151是回文质数。写一个程序来找出范围[a,b](5≤ausingnamespacestd;constintN=1e6+10;vectork;intprime[N];intcnt;boolvis[100000001];voidget_primes(intn)for(inti=2;i0){k.push_back(n%1
雨颜纸伞(hzs)
·
2024-09-09 05:58
算法
c++
Palindrome
Partitioning II (Hard)
Description:Givenastrings,partitionssuchthateverysubstringofthepartitionisa
palindrome
.Returntheminimumcutsneededfora
palindrome
partitioningofs.Example
Ysgc
·
2024-09-04 19:19
【百日算法计划】:每日一题,见证成长(004)
publicstaticbooleanis
Palindrome
(intx){if(x0){y=y*10+x%10;x=x/10;}returnm==y;}思路2转成字符数组,
码上一元
·
2024-08-31 16:19
数据结构与算法
算法
java
数据结构
Palindrome
Pairs
Givenalistofuniquewords.Findallpairsofdistinctindices(i,j)inthegivenlist,sothattheconcatenationofthetwowords,i.e.words[i]+words[j]isa
palindrome
.Example1
z6491679
·
2024-08-31 01:34
acm
leetcode
Palindrome
Pairs
findallpairsofdistinctindices(i,j)inthegivenlist,sothattheconcatenationofthetwowords,i.e.words[i]+words[j]isa
palindrome
.Example1
liuchongee
·
2024-08-31 01:01
leetcode刷题
leetcode
Palindrome
Pairs
https://leetcode.com/problems/
palindrome
-pairs/找出两个字符串拼接可形成回文的所有组合遍历数组,把word和所在位置加入map,再遍历数组,内层遍历当前字符串
gqk289
·
2024-08-31 01:00
LeetCode
Palindrome
Pairs- FB tag
findallpairsofdistinctindices(i,j)inthegivenlist,sothattheconcatenationofthetwowords,i.e.words[i]+words[j]isa
palindrome
.Example1
a568093361
·
2024-08-31 01:00
leetcode
回文子串问题梳理
palindromic-substrings/https://leetcode.cn/problems/longest-palindromic-subsequence/https://leetcode.cn/problems/
palindrome
-partitioning
灵海之森
·
2024-08-28 16:09
算法
python
Leetcode面试经典150题-5.最长回文子串
解法都在代码里,不懂就留言或者私信classSolution{ publicstaticStringlongest
Palindrome
(Strings){ if(s==null||s.length
鱼跃鹰飞
·
2024-08-27 17:42
Leetcode
字节跳动高频面试题
leetcode
面试
算法
17.LeetCode刷题For Swift·680.回文字符串 Valid
Palindrome
II (Easy)
2、思路使用双指针方法,3、代码classSolution{funcvalid
Palindrome
(_s:String)->Bool{//字符串转数组letstrArr=Array(s)//双指针vari
富城
·
2024-08-27 06:26
【每日刷题Day85】
boolis
Palindrome
(char*s){char*arr=(cha
开敲
·
2024-08-23 18:42
每日刷题
算法
数据结构
leetcode
回文链表(leetcode)
我自己第一个写的代码:boolis
Palindrome
(structListNode*head){structListNode*tail=NULL;structListNode*pos=NULL;if(
wx20041102
·
2024-03-04 18:43
链表
leetcode
linux
回文串(三种方法)
,ij确定,子串也就确定,但由于需要先计算出i+1,j-1,所以我们的遍历顺序需要从下往上,既i从大到小,j从小到大,j最小从i开始取classSolution{publicStringlongest
Palindrome
喜欢刷dp的菜菜
·
2024-02-14 07:11
leetcode
算法
c++
数据结构
Day62 验证回文串
给定一个字符串,验证它是否是回文串,只考虑字母和数字字符,可以忽略字母的大小写https://leetcode-cn.com/problems/valid-
palindrome
/将空字符串定义为有效的回文串示例
Shimmer_
·
2024-02-12 13:42
Maximum
Palindrome
s After Operations
Leetcode3035.Maximum
Palindrome
sAfterOperations1.解题思路2.代码实现题目链接:3035.Maximum
Palindrome
sAfterOperations1
Espresso Macchiato
·
2024-02-11 21:25
leetcode笔记
leetcode
3035
leetcode周赛384
leetcode
medium
回文
leetcode题解
Leetcode 9 回文数
boolis
Palindrome
(intx){if(x=x,则跳出循环}//即比较一半的数字即可if(x==num||x==num/10)returntrue;//偶数情况数字对称,可以相等,奇数情况num
柯汝艾
·
2024-02-11 17:11
leetcode
java
算法
07-28 freeCodeCamp 算法题练习
function
palindrome
(str){varstrToArray=str.toLowerCase().split('');//把字符串转换为数组varnewArray=strToArray.filter
小本YuDL
·
2024-02-10 03:51
力扣刷题之旅:进阶篇(三)
一、动态规划(DP)首先,让我们来看一个使用动态规划解决“最长回文子串”问题的代码示例:deflongest
Palindrome
(s:str)->str:n=len(s)ifn1ands[i]==s[i
GT开发算法工程师
·
2024-02-09 13:26
leetcode
算法
职场和发展
力扣之链表9—回文链表
方法1将链表元素存入列表后判断但其时间复杂度和空间复杂度为O(n)classSolution:defis
Palindrome
(self,head:ListNode)->bool:ifnothead:returnTruels
程序媛的攻城之路
·
2024-02-07 23:50
算法与数据结构
链表
指针
数据结构
[力扣 Hot100]Day24回文链表
代码classSolution{public:boolis
Palindrome
(ListNode*head){vectorstack;intn=0;Li
谛听misa
·
2024-02-07 23:45
力扣Hot100题
leetcode
算法
leetcode680 验证回文串 II
文章目录1.解法2.原题[680.验证回文串II](https://leetcode.cn/problems/valid-
palindrome
-ii/)1.解法利用双指针,分别指向s的头尾,如果字母相同
南方乌鸦
·
2024-02-06 06:12
算法
leetcode
数据结构
【面试真题】Javascript 手写编程题
1、题目:编写一个函数,判断一个字符串是否为回文functionis
Palindrome
(str){//转换为小写并移除非字母字符constcleanStr=str.toLowerCase().replace
编程轨迹_
·
2024-02-06 02:48
javascript
前端面试面经
面试
javascript
职场和发展
9.回文数
将整型转换为字符型反转classSolution:defis
Palindrome
(self,x:int)->bool:x=str(x)y=x[::-1]ifx==y:r
叶雨莳
·
2024-02-05 10:38
python
算法
数据结构
面试数据结构与算法总结分类+leetcode目录【基础版】
序号题目1Leetcode274H-Index2leetcode54SpiralMatrix3LeetCode125Valid
Palindrome
4LeetC
心安成长
·
2024-02-04 22:06
leetcode
面试
leetcode
职场和发展
leetcode5 最长回文子串
文章目录1.解法1.1暴力法1.2中心扩散3.3动态规划2.原题1.解法1.1暴力法按顺序,找出所有子串并判断比较classSolution{publicStringlongest
Palindrome
(
南方乌鸦
·
2024-02-04 20:30
算法
leetcode
数据结构
python_蓝桥杯刷题记录_笔记_全AC代码_入门4
凯撒密码2.P1028[NOIP2001普及组]数的计算3.P1036[NOIP2002普及组]选数4.P1149[NOIP2008提高组]火柴棒等式5.P1217[USACO1.5]回文质数Prime
Palindrome
s6
Hooray11
·
2024-02-04 20:25
刷题笔记
笔记
leetcode-回文链表
#classListNode:#def__init__(self,val=0,next=None):#self.val=val#self.next=nextclassSolution:defis
Palindrome
独孤--蝴蝶
·
2024-02-04 16:55
leetcode
代码随想录 Leetcode131. 分割回文串
题目:代码(首刷看解析2024年2月3日):classSolution{public:vector>res;vectorpath;boolis
Palindrome
(conststring&s,intstart
meeiuliuus
·
2024-02-04 08:21
#
leetcode
---medium
前端
算法
javascript
leetcode刷题之回文数(简答题)
代码如下:classSolution:defis
Palindrome
(self,x:int)->bool:xstr=str(x)flag=0
顺利毕业(研)
·
2024-02-04 08:27
leetcode
算法
python
Palindrome
Partitioning
ProblemGivenastrings,partitionssuchthateverysubstringofthepartitionisa
palindrome
.Returnallpossible
palindrome
partitioningofs.Example1
kotic
·
2024-02-04 08:53
leetcode算法学习
深度优先
算法
LeetCode #647 Palindromic Substrings 回文子串
647PalindromicSubstrings回文子串Description:Givenastrings,returnthenumberofpalindromicsubstringsinit.Astringisa
palindrome
whenitreadsthesamebackwardasforward.Asubstringisacontiguoussequenceofcharacterswith
air_melt
·
2024-02-02 21:42
Day09-linux的用户管理2
)交互式设置密码[root@Eva~]#passwdoldboyChangingpasswordforuseroldboy.Newpassword:BADPASSWORD:Thepasswordisa
palindrome
Retypenewpassword
公子千秋
·
2024-02-02 15:15
Java 判断一个数是否是回文数(parlindrome)
代码:importjava.util.Scanner;/*判断一个整数是不是回文数*/publicclass
Palindrome
Num{publicstaticvoidmain(String[]args
爱学习的小仙女!
·
2024-02-02 08:51
Java
java
力扣hot100 长回文子串 中心扩散法 动态规划 一题多解 满注释版
Problem:5.最长回文子串文章目录思路中心扩散法DP思路参考中心扩散法classSolution{publicStringlongest
Palindrome
(Strings){if(s==null
兑生
·
2024-02-01 15:51
力扣
hot100
leetcode
动态规划
算法
面试经典 150 题 -- 双指针 (总结)
125.验证回文串先对字符串进行预处理把大写字符转小写,然后将字母和数字全存入一个vector中;然后运用双指针·来进行判断;classSolution{public:boolis
Palindrome
(
ros275229
·
2024-02-01 01:18
leetcode
算法学习
leetcode
leetcoe面试150题
c++
算法
面试
上一页
1
2
3
4
5
6
7
8
下一页
按字母分类:
A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P
Q
R
S
T
U
V
W
X
Y
Z
其他