 before you can solve any problem, you have to make sure you understand what's asking of you and how it works, right? So this exercise has two parts when you calculate this data. One part is you need to calculate the total using this formula here, it's given here. If you don't have a store math background that could be scary thing, but it just basically a very simple calculation you're multiplying a number from two to 10, including 10, okay? So two, three, four, five, six, seven, eight, nine, 10. You multiply that by each individual number of the nine-digit number you enter and the reverse border, two times two and then three times five, four times four and then you go on. The only thing that's missing is the checks on the digit. We need to figure out what that digit is, which is why you see here it's not included in the calculation. And that's the one we need to figure it out. And so the rule is to just do it this way. So this is part one, okay? Once you get that, you basically find the total number, the total value of those digits. And then from there on, we can figure out what is the check digit? It's gonna be between zero and 10. It's one of those numbers. And you take it out by adding each of these numbers from zero to 10, including 10 to your total value here. And then you check if the number is divisible by 11. If it is divisible by 11, then we can conclude that that number of which way it is between zero and 10, that is the checks on digit, all right? And so here's the example is like I did it here, but really you're basically adding zero to 83. Zero plus 83, is that divisible by 11 or not? If yes, then the digit is zero, right? Otherwise it's not zero, we add the next one. One plus 83 is 84, 84 is not divisible by 11. So before it's not, you keep going until you find a digit that is divisible by 11. And here it's five because five plus 83 is 88. 88 divided by 11, have a mean to a zero. So a mean to zero tells you that is divisible by 11. So therefore the checks on digit is indeed five. So I'm going to read the input. So first I need my nine digit, nine digit, right? Is it input enter digit, enter nine digit. Now I'm not going to convert it to integer because I need to access each individual character in the string of digits. And so when I do this way, my assumption is that my number is going to be, we'll look something like that. And that's my string, right? Nine characters. And then once I get that, that's the only input I need, right? And the next part is just the processing part, okay? So when you process, what do I need? What are the tools I need to process this? Well, I need to calculate the total of all these numbers. I don't know yet, but it's going to be zero, okay? I also need a way to count or to access these numbers from the right down to the left. So remember strings, you can access the index position of each of these characters. I'm going to do from the right to left. How do you know that? I know that it's nine digits, right? So it's given, but even if you don't know, you can get the size of your strings and then you can minus one to get the last position. So here you can put here index, I guess. Index, I'm starting from the right of this list of characters. So the length of the nine digit minus one, okay? This will give me the right most index. I'm at this position now. Okay, make sure you minus one for the one-off situation. And then now I need the other number, right? You can use the while loop if you want to or you can use the full loop. And I'll choose the full loop, in this case, because I know how many I want already. The while loop will also work too. So I can say for every digit N, number N, and the range from two, I don't need one, I don't need zero. I need two. Until 10, I want to include 10, so I would say 11. Remember that the stop number is not included in the calculation here. So if you want to include 10, you must go one above it. And the step is gonna be defaulted to one. You can leave that out like this if you want to, or you can leave it in like this, it doesn't matter. That is my range. These are the numbers from two, three, four, five, all the way to 10, okay? And the idea is that two is gonna be multiplied by my rightmost digit. The next round is three times my second rightmost and so forth. And I'm gonna add the total, so I need a cumulative. So this is the cumulative here, okay? So now all I have to do is I'm gonna multiply N times the nine digit, starting with the index position. But initially it'll be that digit. And then I'm gonna store this entire result to the total. But then I wanna keep a copy of the total what I had earlier, so I put plus equal, that. Only thing is that because remember when I read in my digits on characters. So you wanna make sure that when you read that first character of two, you have to convert it to an integer. But each digit you read, you must convert it to an integer first before you need a multiplication. Otherwise you get a different result. So that is all for the total. And if you wanna see what that total is, you can print it out, okay? So now I wanna run it. It's kind of small, let me get a little bit bigger, okay? So if I enter my, oh, I had it incorrect here. Oh yeah, it's correct because again, right? I never decremented my index. So every time I increase my N, I also need to decrease my index. So right after the total here, I need to make sure that my index is reduced by one, okay? So that was not correct. So again, I do it now. So now you see that my total is indeed 83. So we got the total, that's part one. So process part two is find the checks on the digit, right? Which one is it? It's gonna be between zero and 10. One of those guys. So right over that, I don't know, so I just pick one. Check some, it's gonna be zero. I say it's gonna be zero or 10, it doesn't matter. You can put any number you want because I'm gonna overwrite it. Okay, so now I need to do another loop here from zero to 10. So now do another loop here. I'm gonna go all the way from, I call it I from the range of zero to 10. If I'm going from zero, then the shortcut is just like this, the zero is the default starting point, which I do need it. So let's leave it zero. And then all the way to 10, including 10, so I put 11 and the step is one. So I don't need to do that because it's again, this default. So now initially I've got to start with zero. So I would say total plus the I, right? Is this total, is this entire total here? Divisible by 11. And when we talk about divisible by something, we use the mod operator, which is this percent symbol here. Divisible by 11. If it is divisible by 11, it must be equal to zero. That's how you find if a number is divisible even into that number. If it's anything other than zero, it's not divisible by that number. So then I would say, if this whole thing is true, then I found my I digits. So therefore the check sum digit is indeed equal to I. If it's not divisible by 11, then go to the next number, which is one, and then add a one to the total and then check it again. Right, until you reach this truth point. And it's guaranteed because every number between zero and 10, every group is divisible by 11, right? Okay, 11, 22, right? So for sure, I'm going to find it. So when I'm done, I can print out or check my check sum. It's going to be a check sum. See if it's not correct or not. I'm not going to output it, okay? I'm just printing so I know my notes. So if it's correct, then this should be five. And I'm going to paste that here. And as you can see, indeed it is five because five plus eight three is 88. 88 divided by 11. So 88 divided by 11 is remainder of zero. And because this is true, my check sum digit is going to be five.