 Okay, guys, I'm going to explain this problem of division to 632 b, and I'm going to explain to you guys how to do this problem. Okay, so what is a problem? So basically, you're given this array, and you can form this operation, I can pick two indices, I and j, j has to be greater than i by the way, and I add the elements up, and then I replace my jth index with that value. So if I pick these two, I'm going to add negative one to zero, and then that's going to get me one negative one, negative one, because I'm going to replace my jth value, this value, with the sum of these two, right, negative one plus zero, negative one, right there. Okay, and so what are the operations I could do with this? So let's say I have negative one zero again, I could do, I could get to one negative one, negative one, I also could pick these two, right, and then replace this jth value, right, this i and j, and then replace this value. So I could add these up, and I get one, one plus negative one is zero, so I'm going to replace my jth value with that. So zero, zero. And then now, what's the last one, I could pick this value, and this value, right, I could pick this one and this one. So I could pick this i, and this j, remember, j has to be greater than i, and then add them up. So then one plus zero is one. So then I could get one negative one, and then replace the jth value with one. Okay, so this these are the arrays I could get just from picking these two indices and adding them up and then replacing the jth value with that, the sum of those two indices. Okay, so that's an operation that we're doing. So now the problem statement is basically is that given an array, any numbers like a one, a two, a three, yada yada. So this is the problem statement. Given an array, can I get to b, b one, b two, b three? Given an array, a one, a two, a three, yada yada. Can I get to b, b one, b two, b three? The second array, by using these operations, by using any one of these operations. So by picking two indices, adding them up, and then replacing the second, the second indices value with the sum of the two. So that's the problem statement. So now let's go over the test cases of the input values and see what we did. So in the test cases, we say that here, I could get to output, yes, from one negative one zero and one one negative two. And what is the reason why? Well, the reason why is because let's say I were to have one negative one zero, and I want to get to be one one negative two. So what do I do? I could pick. Okay, so I could add these two up. I this I this j, and then I add them up. And I have one negative one, and then I plus j negative one plus zero is negative one. So then that's negative one. And then I could pick it again, two and three. Then I get one negative one, and add negative one plus negative one is negative two place that with there. Okay, so that I get one negative one, negative two, then to get one one negative two, I could pick these two values, add them up. So now I get one zero negative two, and I pick could pick these two values again. So I could get one one negative two. Okay, so those are the operations I could do to get from A to B. Let's look at this case, one zero one 41. So one zero one 41. And the reason why this is yes, is that I could actually just add one to zero that many times. So zero plus one is one. And then I could do it 41 times. And then I'll get 141. And I'll be the same thing as this B value. Okay. And then let's look at this one, negative one zero negative one negative 41. So what did they do they took negative one added zero, and they did that 41 times. So I generally know the operations to do but I don't know how to get to the answer to the solution. Okay, I don't you don't actually know how to get there unless you physically brute force it. But there's a pattern. Okay, let's say in my this value, whatever I'm looking at here is less than this value. Right negative one's less than one. Well, how can I get negative one to one? Easy. I add one that many number of times, right. If I could take negative one, just keep adding one and one and one and one sooner or later, I will get to this value one. And it doesn't matter if this value is one 100 200 300 whatever value, if this value is greater than this, right, I could I just all I need to do is add in one and then I would be able to get this number. So as long as there's a number one in my previous array here, I could get to this value one. Okay, that's that's basically that's that. Now, what if this value is greater than what if my current a value here is my array A or AB, what if my value here is greater than this value? Right? Well, my value a is greater than my value B. Then how am I supposed to do it by getting to this value B simple, I just have to subtract one that many times, right. So, like if I were to get, if I want to get for zero to negative 41, I just have to subtract negative one 41 times, right. And how do I do that? Well, simple. If there's a negative one in my array A here, any negative one values, I could just add these two together side by side that many number of times and I would get negative 41. Okay, so if my value of my A value is larger than my value of my B value at a certain index, I have to make sure there's a negative one there. So then I could just keep adding and then I get negative 41. And that makes it tab yes. So there's two cases. One is that if the value is less than, then I have to make sure there's a one in the my array A that I could add it up with, and then I could get my whatever value I'm at. And the second case is my value is less than it if zero is less than negative 41, I have to make sure there's a negative one in any of my values in my array A. And then I could add those two that pick those two value up, keep adding them, keep subtracting negative one from it. Then I would get my smaller value. And that's it. That's pretty much the whole algorithm of this. I'm going to show you guys a code now. And that's pretty much it. All right, guys, so I'm going to go over the code right now. So I read in T to test cases and I read in N, which is the length of my array. I have my array A and B. I create a same Boolean, which checks if both of the arrays are the same. So I'm going to read in A, and I'm going to read in B. And then if B is not equal to A, I just know that the same same is false. I create a Boolean called possible is equal to true. And I create a Boolean called has a negative one, and has one, and they set both of them as false. All right, guys, so when I remember I said that the array had to have a one and a negative one, right? That is true, except remember the one and the negative one has to be before the value of what you're, what you searched it at. All right, I forgot to mention that. So like if I remember if I'd said like, AI is less than B of I, that means that I had to have a negative, I had to have a one before it. I had out of one before the index that I'm currently at checking it. Okay, so I had to have a value one before the index of I saw at least some position before the index of I. Okay, so yeah, so I loop through from I equals zero to the end of the array. I check if my AI is less than B of I, and then I check if I don't have a one. So if I don't have a one, then I'm going to set possibly equal to false. If then I check if my array at I is greater than B of I, then I have to check if it doesn't have a negative one, then I set the possibly equal to false. And these conditions, check if it's like, had it one or negative one before it, right? So AI is equal to one, then I said has one equal to true. If AI is equal to negative one, I said has negative equal to true. And that's pretty much it. Then I chav if it's the same. So remember if there's two arrays are the same, then I have to set possibly equal to true because like that means that both of them, if you could do no operations, remember, so that's if the arrays are the same, then you could do no operations. Yeah, so then my last if is a if it's possible I print out yes, otherwise I print out no. So yeah, that's the code here. I hope you guys enjoyed this video right, come subscribe, I'll check you guys later. Peace.