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

Added a length comparison between words #55

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

Conversation

akeefe83
Copy link

Bug found was that words that consisted of the same letter multiple times did not work with the hash map, leading to shorter words containing the same letters being seen as anagrams of longer words (i.e. "ban" and "banana", since the hashmap just overwrites previously seen keys). To fix this, a few lines were added to check if the words were the same length to begin with, if not the method returns false before utilizing the hash map.

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.

1 participant