13_palindromes: Add odd/even-length tests - #661
Merged
mao-sz merged 1 commit intoJul 28, 2026
Conversation
mao-sz
approved these changes
Jul 28, 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.
Because
If a user came up with an improperly implemented two-pointer solution to 13_palindromes, it could still pass all of the previous test cases, due to all of the previous test-cases only using valid odd-length palindromes. I thought it would make sense to clearly define one test as being for a valid even-length palindrome, and another test being for a valid odd-length palindrome, just in case somebody else at some point in the future decides to adjust the strings used in the test cases again, in order to help prevent them from mistakenly making all of the test cases either all odd-length or all even-length.
This PR
Issue
Closes #659
Additional Information
N/A
Pull Request Requirements
location of change: brief description of changeformat, e.g.01_helloWorld: Update test casesBecausesection summarizes the reason for this PRThis PRsection has a bullet point list describing the changes in this PRIssuesection/solutionsfolder