Amit Kumar’s Post

🚀 DSA Deep Dive – Day 24 Solved my 5th 1-D Dynamic Programming problem today. 🚀 And I realized most developers misunderstand Palindrome problems. The question never said “use DP table.” 🤯 It simply asked to return the longest palindromic substring. Here’s what I learned 👇 • Palindromes expand from a center 🎯 • Every index can be a potential center • Handle both odd & even length cases • Expand while characters match • Track the longest window Brute force: O(n³) ❌ Better check: O(n²) Optimized (Expand Around Center): O(n²) with constant space ⚡ The interesting part? This problem is tagged under Dynamic Programming. But you don’t actually need a DP table to solve it efficiently. Lesson: DP isn’t about building tables. It’s about recognizing structure and eliminating unnecessary work. Smart thinking > Category memorization. Follow for more DSA insights 🚀 #LeetCode #DSA #DynamicProgramming #CodingJourney #SoftwareEngineering #InterviewPrep #ProblemSolving #100DaysOfCode #Developers #TechCareers

  • No alternative text description for this image

To view or add a comment, sign in

Explore content categories