C-Sharp-Algorithms icon indicating copy to clipboard operation
C-Sharp-Algorithms copied to clipboard

IsAnagram logic needs to be fixed

Open harsh-athalye opened this issue 9 years ago • 1 comments

I think the IsAnagram() method doesn't work as expected. For example, it would fail for the below string combinations ("abc","bbb") or ("acdf", "bcde").

I think a simple LINQ implementation would be easy enough to implement here. If you like, I could do that and also implement unit tests for it.

harsh-athalye avatar Aug 20 '15 03:08 harsh-athalye

Hi, thanks for your comment. I am well aware of that issue but haven't pushed the new fixes yet. I would like to know your comment regarding the new changes when I push them, so please do keep checking it.

On a side note, I think it would be more meaningful (from an educational standpoint) to have an algorithmic implementation that doesn't depend on LINQ, since you don't exactly know what happens under the hood. :)

aalhour avatar Aug 20 '15 06:08 aalhour