Hi everyone.
Let's do this question given an array of strings consisting of lowercase English letters.
Group the anagrams together.
You can return the answer in any order.
An anagram is a word or phrase formed by rearranging the letters of a different word or phrase, using
all the original letters exactly once.
For example, you have Ark over here and you have car over here, so you can see that when you see,
look at the letters.
So you have a ark, and in car also you have ark.
So these are anagrams.
All right.
So these two are anagrams.
Now the question says that we are given an array of strings.
So this is the array of strings.
And we have in it strings consisting of lowercase English letters.
Now in you in this array we have to group the anagrams together.
So that's this question.
For example you can see a or C and C are these two are anagrams.
So they have to be grouped together.
So we have this array over here.
And then Cat Act and ATC.
These are anagrams.
So these three strings are grouped together.
And then we have just a b c over here.
And then this array has to be returned.
So that is this question.
Now let's go ahead and write a few test cases.
We have already seen this test case.
If this is the array which is given to us, then this is the output that we have to give back.
Now let's say the array which is given to us has just one string in it.
In that case, we can have only one group.
And that group is going to have just this particular string in it.
Right.
So this is going to be the output in this case.
And if the array which is given to us is going to be empty, then we cannot make anything else except
this one group which is also having an empty string inside it.
So this is going to be the output.
All right.
So we have understood the question and we have gone ahead and taken a look at a few test cases in the
next video.
Let's try to think how we can solve this question.