Adding new implementation of sorting by anagrams