add leetcode Longest Chunked Palindrome Decomposition#1184
Merged
Panquesito7 merged 5 commits intoTheAlgorithms:masterfrom Jan 18, 2023
Merged
Conversation
Panquesito7
reviewed
Dec 27, 2022
Co-authored-by: David Leal <halfpacho@gmail.com>
fix review
tjgurwara99
approved these changes
Jan 18, 2023
Comment on lines
+30
to
+31
| if (ch == text[textLen - 1 - index - i] | ||
| && equalSubstrings(text, index, textLen - 1 - index - i, i + 1)){ |
Member
There was a problem hiding this comment.
Again this is something general, but whenever you come across long conditional statements like these, it is better to name the conditions for easy readability. The way to do this is create a function with the name of the condition and the inputs it takes. The arguments shouldn't do any calculations by themselves but arguably this is fine for now 😄.
Always know that code is read much more often than written so it may be easier to write things like this when you have the context since its fresh in mind but when you come back to it after a while, even you who's written it will have to figure out why you wrote something.
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.
Description of Change
Add a guide for new LeetCode solutions.
References
Checklist
Notes: