fishercoder1534 / Leetcode

Solutions to LeetCode problems; updated daily. Subscribe to my YouTube channel for more.

Home Page:https://youtube.com/FisherCoder

Repository from Github https://github.comfishercoder1534/LeetcodeRepository from Github https://github.comfishercoder1534/Leetcode

_49 test case seems to be incorrect

pacificlion opened this issue · 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!