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

LIndsay - edges - reverse words #25

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

Conversation

elle-terch
Copy link

No description provided.


end

return my_words

Choose a reason for hiding this comment

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

Since you're manipulating the string in-place, you don't need to return nil or my_words. Line 33 could simply be return.

end
end

my_words = reverse(my_words, first_index, last_index)

Choose a reason for hiding this comment

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

Since you're manipulating the string in place, you don't need to assign the return value of reverse to my_words.

@shrutivanw
Copy link

Looks good!

I added some minor comments inline. Couple more notes:

  • Although your algorithm does work for the last test case " evol ", the algorithm does not explicitly handle multiple, consecutive white spaces. Can you think of how to add explicit consideration for the same?
  • I didn't see any description or comments on the time and space complexity. Slack me if you have any questions about it.

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