Загрузка...

Palindromic Substrings | Count All Palindromes | Brute Force + Optimal (Python, C++, Java)

In this video, we solve the Palindromic Substrings problem from LeetCode, where we need to count all possible palindromic substrings in a given string.

We begin with the brute force approach to build intuition and understand how substrings work, then move to the optimal solution using the expand around center technique.

You will learn:

What exactly is a palindromic substring
Difference between substring and subsequence
Brute force approach and why it is inefficient
Optimal expand around center approach (O(n²))
How to count all palindromes efficiently
Clean and interview-ready code in Python, C++, and Java

This is a very important string problem frequently asked in coding interviews and helps strengthen your understanding of two pointers and string traversal.

Rising Brain (DSA Sheet):
https://www.risingbrain.org/sheet

Connect with me here:

LinkedIn – https://www.linkedin.com/in/anjalikumari22/

Instagram – https://www.instagram.com/rbanjali.codes/

Twitter (X) – https://x.com/anjali1kumari?s=21

Видео Palindromic Substrings | Count All Palindromes | Brute Force + Optimal (Python, C++, Java) канала RisingBrain
Яндекс.Метрика
Все заметки Новая заметка Страницу в заметки
Страницу в закладки Мои закладки
На информационно-развлекательном портале SALDA.WS применяются cookie-файлы. Нажимая кнопку Принять, вы подтверждаете свое согласие на их использование.
О CookiesНапомнить позжеПринять