please explain me the sorting logic applied that how we are depicting that by sorting the elements will help in keeping the anagrams together
Anagrams together
@dheerajmishra992 property of anagrams is that they are different permutations of each other. So if you sort both of them, they will produce the same result.
eg cba and cab are anagrams, if you sort them, both of these become abc
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.