647. Palindromic Substrings [Java] - Leetcode

preview_player
Показать описание

Given a string, your task is to count how many palindromic substrings in this string.

The substrings with different start indexes or end indexes are counted as different substrings even they consist of same characters.

[0:07] - Question explanation

Example 1:

Input: "abc"
Output: 3
Explanation: Three palindromic strings: "a", "b", "c".


Example 2:

Input: "aaa"
Output: 6
Explanation: Six palindromic strings: "a", "a", "a", "aa", "aa", "aaa".


Note:

The input string length won't exceed 1000.

Solution
[1:30] Code in Java
[5:11] Explanation using Example

PlayLists Available -

Follow me here -
Рекомендации по теме
Комментарии
Автор

Great initiative and well explained ..keep up the good work !!🔥

pranavanand
Автор

u should keep your pic smaller as it hides the code

ritikeshsharma
Автор

Please describe the intuition behind the solution rather than explaining the code. Thanks

kirtimanmishra
welcome to shbcf.ru