perf(strings): optimize LongestCommonSubstring DP memory to O(N) and … - #7613
Merged
DenizAltunkapan merged 4 commits intoSep 22, 2026
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #7613 +/- ##
============================================
- Coverage 81.19% 81.18% -0.02%
+ Complexity 7900 7897 -3
============================================
Files 830 830
Lines 25012 25012
Branches 4882 4882
============================================
- Hits 20308 20305 -3
Misses 3920 3920
- Partials 784 787 +3 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
irenemrtinez
marked this pull request as ready for review
September 22, 2026 13:58
irenemrtinez
requested review from
DenizAltunkapan,
alxkm and
yanglbme
as code owners
September 22, 2026 13:58
DenizAltunkapan
approved these changes
Sep 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
LongestCommonSubstringto use a 1D DP array (O(min(N, M))dynamic memory) instead of a 2D matrix (O(N * M)).LongestCommonSubstringTest.javacovering unicode characters, whitespace, repeated patterns, null/empty inputs, and boundary conditions.Checklist
clang-format -i --style=file path/to/your/file.java