Skip to content

add leetcode Longest Chunked Palindrome Decomposition#1184

Merged
Panquesito7 merged 5 commits intoTheAlgorithms:masterfrom
alexpantyukhin:add_leetcode_longest_chunked_palindrome_decomposition
Jan 18, 2023
Merged

add leetcode Longest Chunked Palindrome Decomposition#1184
Panquesito7 merged 5 commits intoTheAlgorithms:masterfrom
alexpantyukhin:add_leetcode_longest_chunked_palindrome_decomposition

Conversation

@alexpantyukhin
Copy link
Member

Description of Change

Add a guide for new LeetCode solutions.

References

Checklist

  • Added description of change
  • Added file name matches File name guidelines
  • Added tests and example, test must pass
  • Relevant documentation/comments is changed or added
  • PR title follows semantic commit guidelines
  • Search previous suggestions before making a new one, as yours may be a duplicate.
  • I acknowledge that all my contributions will be made under the project's license.

Notes:

@Panquesito7 Panquesito7 added the Leetcode folder changes Changes to Leetcode folder. Known CI issues. label Dec 27, 2022
alexpantyukhin and others added 2 commits December 27, 2022 11:04
Co-authored-by: David Leal <halfpacho@gmail.com>
fix review
Copy link
Member

@Panquesito7 Panquesito7 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! 🚀

Comment on lines +30 to +31
if (ch == text[textLen - 1 - index - i]
&& equalSubstrings(text, index, textLen - 1 - index - i, i + 1)){
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@Panquesito7 Panquesito7 merged commit 02c0104 into TheAlgorithms:master Jan 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Leetcode folder changes Changes to Leetcode folder. Known CI issues.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants