# Algorithms Part3, Strings. areAnagram2 method is incorrect

**URL:** <https://forum.codewithmosh.com/t/algorithms-part3-strings-areanagram2-method-is-incorrect/23755>\
**Category:** Uncategorized\
**Created:** [November 20, 2023, 3:00am UTC](https://forum.codewithmosh.com/t/algorithms-part3-strings-areanagram2-method-is-incorrect/23755 "2023-11-20T03:00:53Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![pk4](https://avatars.discourse-cdn.com/v4/letter/p/dec6dc/32.png) [@pk4](https://forum.codewithmosh.com/u/pk4)\
**Post date:** [November 20, 2023, 3:00am UTC](https://forum.codewithmosh.com/t/algorithms-part3-strings-areanagram2-method-is-incorrect/23755/1 "2023-11-20T03:00:53Z")

</div>

areAnagram2 method. The length comparison of the first and second strings is missed, hence the method doesn’t work correctly. E.g. areAnagram2(“aaabb”, “abba”) returns “true”, but supposed to return “false” in this case.
