# Longest Palindromic Substring


## 🧠 Problem

Given a string s, return the longest palindromic substring in s.

---

### 🏷️ Tags  
`String,Dynamic Programming`

---

### 📊 Difficulty  
**Medium**

✅ Success Rate: **31.8%**  
📥 Submissions: **5,618,701**  
📈 Accepted: **1,784,028**

---

### ❤️ Reactions  
👍 Likes: **17097**  
👎 Dislikes: **1005**

---

### 💡 Hints

How can we reuse a previously computed palindrome to compute a larger palindrome? If â€œabaâ€ is a palindrome, is â€œxabaxâ€ a palindrome? Similarly is â€œxabayâ€ a palindrome? Complexity based hint:
If we use brute-force and check whether for every start and end position a substring is a palindrome we have O(n^2) start - end pairs and O(n) palindromic checks. Can we reduce the time for palindromic checks to O(1) by reusing some previous computation.

---

### 🔁 Similar Questions

- Shortest Palindrome
- Palindrome Permutation
- Palindrome Pairs
- Longest Palindromic Subsequence
- Palindromic Substrings

