Skip to content
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

Agr_Pushpa_Palindrome_check #22

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

pushpaagr
Copy link

Space complexity is constant as the number of variable will remain the same regardless of how long the string is, and the time complexity is linear as the iteration will depend on the length.

@shrutivanw
Copy link

Nice work!

Can you think of an algorithm which does not alter the input string and also doesn't increase the space complexity? Hint: how can you skip white spaces as you compare the characters from the front to back?

Give it some thought. Then, take a look at one such solution at: https://github.com/Ada-C10/palindrome_check/blob/solution/lib/palindrome_check.rb

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants