You are given n strings and you have to arrange anagram strings in separate line in order. for example:
Input:
n = 7
aabbcc
acbabc
abccba
bcba
ab
aa
abbc
Output:
aa
aabbcc abccba acbabc
ab
abbc bcba
Explanation: output strings in same lines are anagram in Lexicographically order also strings in different lines are also Lexicographically arranged.
I am trying to solve the problem but my code showing runtime error
here is my code: http://ideone.com/UoJmN0
please help