If you know the idea, the source code is not that hard.
So basically for each and every note between one and M.
I just read it's color X, color of A equals X.
Then I store an array of pairs of eyes is equal to the pair except eyes or the color.
I call it color and the mode.
Then I sorted obviously by colors.
And after doing that I take the node, which is the second number from despair and I count how many
numbers are different.
Right.
Which is no different.
And for each and every neighbor, if its color is less or equal than the color of node, I just increase
the number of different numbers.
And then I say that the, uh, eye mark basically in my frequency array that color to be true because
I don't want to counted twice.
Right.
It's not going to be different anymore.
If I do that.
And of course, if the number of different things is different than the color minus one, I print minus
one Indian after I do that.
Of course, I have to make sure I reset this frequency array because if I don't, I'm gonna go to another
node.
And this frequency array is gonna stay the same.
Right.
So, uh, also iterate the neighbors to reset the frequency.
Right.
Don't reset the frequency by something like what was that called?
It was some function C.
Who?
Which kind of reset the values.
Mom said don't use, mom said.
Or for loops of size.
One hundred thousand for that.
Make sure you visit each and every neighbor again.
And market.
That's false.
Right.
Because only the neighbors were changed in the process.
And that's gonna be fine.
Right.
So, yeah, that's it.
And I think it shouldn't have been accepted if it was by me, because I don't know yet.
You can correct me if I'm wrong.
I don't know if this approach actually takes into account the possibility that I have a neighbor equal
to X, so I don't really know.
If I take it into account.
So it might happen that I have.
Exactly.
Call or minus one.
Different neighbors.
But one of them is still caller and that's not correct.
So yeah, I don't know.
It is accepted.
I am happy with that.
But I think it shouldn't have passed all the test cases.