educative.io

Needs better testcases to avoid map vs set confusion

This problem needs more and better testcases (seems to be the case for many problems in this course). I see multiple comments about why is not a set used instead of a map, to track characters. This situation would easily be avoided with a testcase such as:

"rraaaci", 1

This should return 3, but when a set is used instead of a map, it returns 4.

1 Like

Hi @Claudiu,

Thank you for pointing this out. We will be incorporating new test cases so that it becomes clear why sets can’t be used in this problem.

1 Like

Hi @Claudiu , i tried my set() approach on the example mentioned above and it returns 3. How is it returning 4 in your case. do you have more such test cases?