The Code Shelf
Published in

The Code Shelf


Day 21: The “Longest Palindromic Substring” Problem


Given a string s, find the longest palindromic substring in s. You may assume that the maximum length of s is 1000.

Example 1:

Input: "babad"
Output: "bab"
Note: "aba" is also a valid answer.

Example 2:

Input: "cbbd"
Output: "bb"




Well-curated thoughts about different programming paradigms, concepts etc., written with a cup of coffee

Recommended from Medium

Common JavaScript interview questions

Camunda modeler in Angular

Modeler without BPMN template


Image Composition with Transparent Image by OpenCV

React Native Facebook Login: The Hard Way + The Expo Way

Abstract Class In Typescript

The Holy Trinity Of Every Animation | Circular reveal animation example

Algorithmic Trading in TypeScript(CCXT)

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Anjana Sudhir

Anjana Sudhir

Senior Software Engineer & Scrum Master @ Agoda (Booking Holdings Inc.)

More from Medium

CODE IT YOURSELF ! #01 Linked List.

Longest Binary Subsequence Less Than or Equal to K

Remove Null, None, and Empty Strings from an n-sub level dictionary