Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#289 added longestpalindromic substring #291

Merged
merged 2 commits into from
Oct 4, 2024

Conversation

albinsabu2023
Copy link
Contributor

#289

Added longest palindromic substring in c++

Longest Palindromic Substring

This algorithm finds the longest palindromic substring in a given string using the expand-around-center technique.

Explanation

  • expand: Expands from the center (left, right) while characters match and returns the palindrome found.
  • longestPalindrome: Iterates through each character, treating it as the center for both odd-length (single character center) and even-length (two-character center) palindromes. For each center, the expand function checks and finds the longest palindrome, updating the result accordingly.

The final result is the longest palindromic substring in the input string.

@Saloni6111 Saloni6111 added the hacktoberfest-accepted contribute for hacktoberfest 2024 label Oct 4, 2024
@Saloni6111 Saloni6111 merged commit 7ef36aa into Saloni6111:main Oct 4, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hacktoberfest-accepted contribute for hacktoberfest 2024
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants