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.
Related topics
| Topic | Replies | Views | Activity | |
|---|---|---|---|---|
| Sorting Arrays (Comparator Function) | 6 | 6883 | December 8, 2020 | |
| Topic 3-1 Comparison Operators | 2 | 513 | July 19, 2021 | |
| Reverse a string | 2 | 515 | October 7, 2022 | |
|
Java Strings & Substrings
|
3 | 330 | September 12, 2022 | |
| Probable Mistake in Solution- First Repeated Character | 5 | 1145 | August 3, 2022 |