Object-Oriented Programming · Bloomberg · Medium
Task 1: Check If Two Strings Are Anagrams Two strings are anagrams when they contain exactly the same characters with the same frequencies. The order of the characters does not matter. Approach 1: Sort and Compare If two strings are anagrams, sorting their characters puts them into the same order. For example, sorting both "triangle" and "integral" produces "aegilnrt", so comparing the sorted results directly answers the question. The first check is length. If the lengths…
Checking your access…