Menu
Coddy logo textTech

Longest Palindrome

Lesson 2 of 3 in Coddy's Interview Coding Challenges - Pack VII course.

challenge icon

Challenge

Medium

Write a function named longestPalindrome to find the longest palindromic substring in a string.

A palindromic substring is a substring that is also a palindrome.

The function should take a string as input and return the longest palindromic substring.

If there are multiple palindromic substrings of the same length, the function should return the first one that appears in the string.

Try it yourself

char* longestPalindrome(char* s) {
    // Write code here
}

All lessons in Interview Coding Challenges - Pack VII

1Challenges

Palindrome CheckerLongest PalindromeMinimum Palindrome Cuts