fishercoder1534/Leetcode

_49 test case seems to be incorrect

pacificlion opened this issue · 1 comments

Hi,
the test case written for _49 does not check if anagrams are grouped together correctly. It only cares if all the elements given in input are a part of the actual ArrayList. Eg: if I have incorrect grouping as follows for expected , the test case will still pass:

{
  {"eat", "ate", "tea"},
  {"tan"},
  {"nat","bat"}
}

assertEquals(expected.containsAll(actual), actual.containsAll(expected));

Please let me know if I missed anything

Regards,
Prashant

Good call, I've just fixed this. Thanks!