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

hasCode solutions do not cover all the cases #1

Open
adjorno opened this issue Nov 10, 2017 · 0 comments
Open

hasCode solutions do not cover all the cases #1

adjorno opened this issue Nov 10, 2017 · 0 comments

Comments

@adjorno
Copy link

adjorno commented Nov 10, 2017

For example,
XOR solution will fail on test cases like this:
7
trees bike cars steer arcs arrrcs carrrs

The reason is that hash code of "arcs" and "arrrcs" is the same and they are not anagrams. You should not keep hash code as a key of your HashMap because of collisions.

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

No branches or pull requests

1 participant