We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0bc31fe commit c035853Copy full SHA for c035853
palindromic-substrings/s0ooo0k.java
@@ -4,12 +4,12 @@ public int countSubstrings(String s) {
4
int cnt = 0;
5
6
for(int i=0; i<s.length(); i++) {
7
- cnt += palindrom(s, i, i);
8
- cnt += palindrom(s, i, i+1);
+ cnt += palindrome(s, i, i);
+ cnt += palindrome(s, i, i+1);
9
}
10
return cnt;
11
12
- public int palindrom(String s, int left, int right) {
+ public static int palindrome(final String s, int left, int right) {
13
14
while(left>=0 && right < s.length() && s.charAt(left)==s.charAt(right)) {
15
cnt++;
0 commit comments