I was implementing a code that prints all the anagrams together. Now I am stuck and I don't know how to move forward.
What I want to do is :
Given an array str[]={"cat","dog","tac",god"}
I create an array dup[]
same as str[]
.
Now I sort the duplicate array which now becomes {"act ","dgo","act","dgo"}
Here I find the indexes of same elements i.e. 0 and 2 && 1 and 3
In original array I print the index 0 and 2 together and 1 and 3 together ,
Now I don't know how to sort the string without changing the indices .