-
Notifications
You must be signed in to change notification settings - Fork 19.9k
Add Manacher’s Algorithm for Longest Palindromic Substring #5462
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
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #5462 +/- ##
============================================
+ Coverage 52.18% 52.28% +0.09%
- Complexity 3245 3255 +10
============================================
Files 524 525 +1
Lines 15156 15183 +27
Branches 2881 2887 +6
============================================
+ Hits 7909 7938 +29
+ Misses 6921 6920 -1
+ Partials 326 325 -1 ☔ View full report in Codecov by Sentry. |
- Added parameterized tests for longestPalindrome, empty cases, complex cases, and sentence palindromes. - Removed unnecessary comments for cleaner code. - Renamed variable `p` to `palindromeLengths` for clarity based on code review feedback.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Resolved all comments. Changed files to support review.
Thank you for your contribution |
clang-format -i --style=file path/to/your/file.java
This PR adds Manacher's Algorithm to find the longest palindromic substring in linear time.
Closes #5453