Please use Laptop/Desktop or any other large screen for the Mock Interview Session.

Longest Palindrome and Minimum Partitions



YouTube Video Thumbnail
Link

Watch above sample mock interview video to see how it works.
Login and Buy Premium to Start the Interview



Longest Palindromic Substring Problem

Longest Palindromic Substring

Problem Statement

Given a string text, find the longest substring within text that reads the same forwards and backwards. You can assume that the length of text will not exceed 1200 characters.

Examples

Example 1:
Input: "radarlevel"
Output: "radar"
Note: "level" is also an acceptable answer.

Example 2:
Input: "forgeeksskeegfor"
Output: "geeksskeeg"

Constraints

  • 1 ≤ length of text ≤ 1200
  • text consists of printable ASCII characters.