-
Notifications
You must be signed in to change notification settings - Fork 11
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
Possible issue in cancer.alan #41
Comments
kostis
added a commit
that referenced
this issue
Dec 3, 2024
Thanks for the issue. Actually, I had already noticed this and had fixed it in my checked out version of the repository. @purpl3F0x : can you please double check the #42 PR? |
Yes, it seems to be working, as intended. > ./test_cancer.exe
Give a string with maximum length 30: anna
anna ... is palindrome
> ./test_cancer.exe
Give a string with maximum length 30: anNna
anNna ... is palindrome
> ./test_cancer.exe
Give a string with maximum length 30: bob
bob ... is palindrome
> ./test_cancer.exe
Give a string with maximum length 30: alice
alice ... is not palindrome
> ./test_cancer.exe
Give a string with maximum length 30: anna #<---has trailing space
anna ... is not palindrome
|
kostis
added a commit
that referenced
this issue
Dec 4, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I think,
there is an issue in cancer.alan.
At the main function, there is an "strlen" algorithm that calculates the String length "n", then decrements the value by 1. (lines 24-26).
Then n gets passed along the sting to
cancer()
and gets reduced again.This will make only strings like "annaX" pass, instead of "anna"
The text was updated successfully, but these errors were encountered: