Class Solution
java.lang.Object
g0601_0700.s0647_palindromic_substrings.Solution
647 - Palindromic Substrings.<p>Medium</p>
<p>Given a string <code>s</code>, return <em>the number of <strong>palindromic substrings</strong> in it</em>.</p>
<p>A string is a <strong>palindrome</strong> when it reads the same backward as forward.</p>
<p>A <strong>substring</strong> is a contiguous sequence of characters within the string.</p>
<p><strong>Example 1:</strong></p>
<p><strong>Input:</strong> s = “abc”</p>
<p><strong>Output:</strong> 3</p>
<p><strong>Explanation:</strong> Three palindromic strings: “a”, “b”, “c”.</p>
<p><strong>Example 2:</strong></p>
<p><strong>Input:</strong> s = “aaa”</p>
<p><strong>Output:</strong> 6</p>
<p><strong>Explanation:</strong> Six palindromic strings: “a”, “a”, “a”, “aa”, “aa”, “aaa”.</p>
<p><strong>Constraints:</strong></p>
<ul>
<li><code>1 <= s.length <= 1000</code></li>
<li><code>s</code> consists of lowercase English letters.</li>
</ul>
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
Solution
public Solution()
-
-
Method Details
-
countSubstrings
-