an anagram detection example good example problem for showing algorithms with different orders of magnitude is the classic anagram detection problem for strings one string is an anagram of another if the second is simply rearrangement of the first for example'heartand 'earthare anagrams the strings 'pythonand 'typhonare anagrams as well for the sake of simplicitywe will assume that the two strings in question are of equal length and that they are made up of symbols from the set of lowercase alphabetic characters our goal is to write boolean function that will take two strings and return whether they are anagrams solution checking off our first solution to the anagram problem will check to see that each character in the first string actually occurs in the second if it is possible to "checkoffeach characterthen the two strings must be anagrams checking off character will be accomplished by replacing it with the special python value none howeversince strings in python are immutablethe first step in the process will be to convert the second string to list each character from the first string can be checked against the characters in the list and if foundchecked off by replacement def anagram_solution ( , )a_list list( pos still_ok true while pos len( and still_okpos found false while pos len(a_listand not foundif [pos =a_list[pos ]found true elsepos pos if founda_list[pos none elsestill_ok false pos pos return still_ok print(anagram_solution ('abcd','dcba')to analyze this algorithmwe need to note that each of the characters in will cause an iteration through up to characters in the list from each of the positions in the list will be visited once to match character from the number of visits then becomes the sum of algorithm analysis