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

Duplicate anagrams produced when the same vector occurs twice in sum #1

Open
matthewearl opened this issue Mar 5, 2015 · 0 comments

Comments

@matthewearl
Copy link
Owner

For example, for an input of "ABAB" and a word list of ["AB","BA"], the vector set {{A:1,B:1},{A:1,B:1}} is correctly generated by _find_anagram_vecs().

_expand_anagram_vecs() then maps this to four anagrams:

  1. AB AB
  2. AB BA
  3. BA AB
  4. BA BA

2 and 3 are equivalent. _expand_anagram_vecs() should be fixed to stop generating such duplicates.

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