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.
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.