Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 30d18dd

Browse files
VaibhavVaibhav
Vaibhav
authored and
Vaibhav
committed
sample question
1 parent 59291d7 commit 30d18dd

File tree

2 files changed

+25
-64
lines changed

2 files changed

+25
-64
lines changed

‎Leetcode/1328. Break a Palindrome .java

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
1328. Break a Palindrome
2+
3+
4+
public String breakPalindrome(String s) {
5+
6+
int l=s.length();
7+
if(l==1)
8+
return("");
9+
10+
char ch[]=s.toCharArray();
11+
for(int i=0;i<ch.length/2;i++)
12+
{
13+
14+
if(ch[i]!='a')
15+
{
16+
ch[i]='a';
17+
return(String.valueOf(ch));
18+
}
19+
}
20+
21+
ch[l-1]++;
22+
return(String.valueOf(ch));
23+
24+
25+
}

‎Leetcode/New_Question copy.java

Lines changed: 0 additions & 64 deletions
This file was deleted.

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /