interview-challenges icon indicating copy to clipboard operation
interview-challenges copied to clipboard

Add test case for repeated letters handling in anagrams

Open ferutizi opened this issue 4 months ago • 0 comments

sesion-7/anagramas

Adds a new test case to the sonAnagramas test suite to ensure the algorithm correctly handles words with repeated letters. The new case checks that words containing the same letters in different repetition counts are not considered anagrams.

  • This test prevents false positives in implementations that ignore repeated letters (for example, those using Set)

Expected result: The test should only pass if the algorithm correctly distinguishes between:

"food" → contains two o "doff" → contains two f

Expected output: false

ferutizi avatar Oct 15 '25 18:10 ferutizi