@@ -0,0 +1,777 @@
+/**%0A * Name: Palindromic Substrings%0A * Number: 647%0A * Tag: extend palindrome%0A * Main Points: extend palindrome%0A * Time Complexity: O(n %5E 2) %22aaaaaaa.....aaaaaaa%22%0A * Space Complexity: O(1)%0A**/%0Aclass Solution %7B%0A    int count = 0;%0A    public int countSubstrings(String s) %7B%0A        if (s == null %7C%7C s.length() == 0) return 0;    %0A        //running mid%0A        for (int i = 0; i %3C s.length(); i++) %7B%0A            extendPalindrome(s, i, i); //odd length%0A            extendPalindrome(s, i, i + 1); // even length%0A        %7D%0A        return count;%0A    %7D%0A    private void extendPalindrome(String s, int left, int right) %7B%0A        while (left %3E= 0 && right %3C s.length() && s.charAt(left) == s.charAt(right)) %7B%0A            count++;%0A            left--;%0A            right++;%0A        %7D%0A    %7D%0A%7D

extend palindrome