Skip to content

Commit c035853

Browse files
s0ooo0kyhkee0404
andauthored
Update palindromic-substrings/s0ooo0k.java
Co-authored-by: yhkee0404 <[email protected]>
1 parent 0bc31fe commit c035853

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

palindromic-substrings/s0ooo0k.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ public int countSubstrings(String s) {
44
int cnt = 0;
55

66
for(int i=0; i<s.length(); i++) {
7-
cnt += palindrom(s, i, i);
8-
cnt += palindrom(s, i, i+1);
7+
cnt += palindrome(s, i, i);
8+
cnt += palindrome(s, i, i+1);
99
}
1010
return cnt;
1111
}
12-
public int palindrom(String s, int left, int right) {
12+
public static int palindrome(final String s, int left, int right) {
1313
int cnt = 0;
1414
while(left>=0 && right < s.length() && s.charAt(left)==s.charAt(right)) {
1515
cnt++;

0 commit comments

Comments
 (0)