Basically, you know, the problem we are given and strings and all of them are of the same length,
which is m the strings consist of lowercase English letters.
And we should find one string equal.
It s.
Such that this Thring differs from each and every of these and strings from the input by utmost one
character.
Right.
So for each string, there is no more than one position g such that.
At string a N.
S are different, in position number G.
And that's it.
We should find one of these drinks.
Cool.
Well, I read the problem and first thing that I noticed.
Is, of course, and is at most 10 and M is a poor that right.
So at this point, the problems seemed pretty interesting.
But when I saw ten and ten, that's like, hmm, I can do something like Enet Power five or let's say
five, because I have 100.
That's.
And I can get away with it.
So I should really go nuts and.
Think about big, big complex it is, right?
And that's what I did.
It was as simple as that.
So what happens here is that you want this final string to differ from each and every of those and strings
by only one charter.
So, first of all, it has to defer.
We have the first of these and strings by only one character.
Right.
So I thought about the first string I've took.
The fourth string.
A of what?
Let's take some example, because it's easier for this example I have we don't even need to draw something
A, B, a, C, right.
So that string S is either equal to the first string A, B, A, C or A differs by only one character.
So what did I do?
What they do is that I have tried each and every possible as possible.
That is right.
So that String S is either equal to a one, as I said, or I take each and every character right.
Each and every position from one to M, and I choose the chair actor, which will replace the character
in the fourth string.
And I have that word and then I move on and try that word and how do I try that word?
I just brute force all the way.
Right.
Fixed position.
Fix the character and then go through each and every string.
And just compare with brute force and check if they differ by only one letter.
Yeah.
So we don't need to draw.
We can actually look at some piece of code.
I guess that's that's pretty good.
So yeah.
Let me see if I can do something about the zoom.
I don't know.
Yeah, I can.
All right.
Good.
Perfect.
You should be able to see pretty well.
So as you can see here.
Right.
I had a function is valid, which is here.
This function is very it just checked even my answer is valid or not.
Right.
And what do I do?
Well, because I know the answer is going to be okay with the first string because I convert the fourth
string into the answer check for each and every other string between two and M and I have a counter
and I basically count how many different characters I have.
And that's all I take each and every position between one and M.
And just increase the counter if they are different in that position or not.
And of course if the counter is greater than one, I return false.
Otherwise, in the end, after I know it's cool with all the other strings I return to and for generating
this answer, I just initialize it with the first word.
So answer, revise answer of one.
And I.
And then I check if it's valid, because this is the first option.
And if this is not valid, I try each and every position from one to M.
Right.
And as long as I did in far, I haven't found a solution.
Basically, I try each and every character, which is different by the character in the first word.
And if it is, I replace it and I check again if it's valid.
Right.
The final time complexity is something like M positions crossed.
Twenty five different characters which could replace the initial one crossed the.
Is valid function which performs another.
M crossed.
M.
So is I think something like 26 crossed.
And Cube which is super rookie is like 26000.
And because I have one hundred test.