help needed in leetcode problem

I am trying to do this [question][1] on leetcode. Can someone please tell me what is wrong with my


[2].
It is giving correct answer on codeblocks for the testcase which is failing on leetcode platform . However the same test case is giving correct answer when I run it as custom input on leetcode. Any suggestions:)
Thanks in advance. Please help.


  [1]: https://leetcode.com/problems/group-anagrams/description/
  [2]: https://drive.google.com/file/d/1qmQJJCaeTM4xjhOYmaJaMfBixEg_32LL/view?usp=sharing

while(v*.second==s)
{
t.push_back(v*.first);
i++;
}

add the condition (i < n) inside the while loop and then try.

edit : [
[“ate”, “eat”,“tea”],
[“nat”,“tan”],
[“bat”]
]

I think that the output format is this i.e. you have to insert brackets also. Not sure about this! btw is there a way to know how many tests are passed? If yes and your code didn’t pass a single test than try to format it that way and try!

Let me know if it doesn’t works.

no success

i’ve updated my answer please look into it and feel free to contact if doesn’t work :slight_smile: