 Hello, everyone. And welcome to today's stream. We're doing day nine of AdWords of Code. We've been coding for three days, so this is a fourth day, and we caught up. We did day one, two, and three, three hours, and we did day four and five and three hours. And then yesterday, we did day six, seven, and eight. And the creator of AdWords of Code even showed up to the stream. Eric Wassil. Shout out to that guy because without him, we would not be here. Hi, little Lennie. My biggest fan. She might be bringing some Haldi milk later. You know, I should always drink Haldi milk because doing otherwise would be unhealthy. Classic joke. Anyway, let's get started with day nine. I don't think it will take three hours today because we're only doing one day. But who knows? Let's see what happens and get on with it. What is today's problem? Let's click day nine. Mirage maintenance. You ride the camel through the sandstorm where the ghost's map told you to stop. The sandstorm stopped to the sides. All right, yesterday we're like doing a map. The answer was least common denominator. We'll see. OK, we found out in Oasis, stretch your neck. There's another floating island made of metal with parts to fix the sand machines. OK, cool. The lore today is excellent. There's even a hand glider. Once the sun rises, it's a sand. Oh, cool. Yeah, because like the warm air erupts from the sand, so it will lift you up. That's cool. It's the middle of another diocese, delicate ecosystem, ecological readings. Maybe you can report anywhere about disabilities. Well, Oasis Instability Center. OK. Your surroundings. The Oasis is pretty nice. But it doesn't report many values and how they are changing over time. Each line in the report contains the history of a single value. For example, rub. Let me check the input. OK, let's parse this. We have a negative number. OK, that changes our parser of it. Well, not too much. OK, let's just see. Let's put a module. Oh, module. Let's just put the language back in here. Right away. OK, and the example is a list of string. Let's see, parse. For example, list of things. And let's copy the split on function from day seven. No, maybe use it day seven, day eight, day six. Day copy. So this is just parse example is equal to parse prime. Where parse example prime string is equal to split on space. And then map read. Let's see, main equal to print. R is example, x. Now, let's say GZO day nine. Like it's day nine, digest, day nine, day nine. How is everyone feeling today? Saturday, I did a bunch of Christmas stuff. It always happens. I don't know. I think it's something in the case or something. Let me see. OK, I think it's maybe just because I have this one at the end. Yeah, OK. So next time I should just do like this. Oh, it should be day nine. OK, nice. Let's just grab the input. Make sure we can parse that also. But with all the negative numbers, read file input into print.pars example. Got it now. OK, no pausing failure. Failure. There are some negatives in there, so that's good. Now, let's get on with the problem itself. OK, each line in the port is because history, prediction of the next value versus always plus three. And then it's 1, 2, 6, 10, 15, 10, 1 plus 2, 2 plus 1 plus 1 plus 2 plus 3 plus 4 plus 5 plus 6. Then it's 3 plus 3 plus 3 plus 3 plus 5. There's some arithmetic here going on. OK, OK. Let's write x, 0, 8, extrapolate. Let's just see. Extrapolate x, y, x is equal to y minus x. Extrapolate, extrapolate. Now, let's just see what happens here. So we get the, I need to extrapolate y, x is, and then, OK, it's just anything left. OK, 3, 3, 3, 3, 3. Let me see. There's a function called apply, I think. It takes in, it's like a list of a to a, a to list of a, iterate, OK? So we're going to say, iterate, iterate, extrapolate. And then we're just going to iterate, extrapolate. And so we're going to map, iterate, extrapolate. And we're going to say, take while, not dot all equal to 0. Will this just crash? It rate is applied to too few arguments. OK, nice. So we're getting all of them that are not 0. Start by adding a new 0 to the end of your list of 0s. Because the 0s represent difference between the values, let me see. OK, so part 1 is equal to list of int. Let's just say part 1 here. What is the type here? I think it's list of int to, OK, nice. Where seek is equal to s is equal to take while s, seek. And then to the end of this list, let's see. I want to say this is going to be, replicate is going to be, replicate 0, right? So replicate, and s, s, s, s. OK, so now we have the 0s. So what do I want to do? We want to fill in the placeholders. Let's actually then, let's just say like this. And then we're going to say map, reverse, s, q. Now d1 is equal to, OK. So I want to look at this sequence. So let's see. And I don't care about map.reverse. I only care about the, it's going to be map.reverse of this. And I don't need that 0 at the beginning, because it doesn't do anything actually. OK, 3 and then 15. So let's do here, OK. So go, so if I have an x and I have a y, this is going to be equal to y plus x by x's. And then go, which is an empty list, right? But then I need the 0 at the front. 0, 3, 15. And then I'm going to say, go, that's 3, 18, OK. And then 1, 7, 28. 1, 7. All right, let's see. So we get 5 plus 6, 1, 7. I think maybe we have to say x like this. 1, 7, 28, 2, 8, 23, 68. OK, nice. 21, 3, 601, 158. You don't add the, so you take the last, OK. And then we do so. Nice. OK, let's do this again. Sound up, and let's see. All right, we got part 1. 25 minutes, not bad. Continue to part 2. Oh, extrapolate backwards as well. For each history, repeat the parts of finding difference until the sequence of the 0. Then rather than adding a 0 to the end, you should instead add a 0 to the beginning of your sequence of 0s. Let's see. Why is it supposed to be so much harder? OK, let's see. What are we doing now? Let's look again at these lists. Ding, ding. Let's reverse it. So 2, 2, 2, 2, 2. So the first one will just add the same number, right? So reverse, reverse. OK, again, we're looking at these numbers. Let's say here. We just want the last one. OK, now 0, 0. 2, 2, 2, 0, 2, 4, 6. What if we map head? Let's see. Got some healthy milk. It's good. Quite hot. 0, 2, 0, 3, 10. 0, 2, 0, 3, 10. Like this. OK, so if you have 0, it must have been, don't you just do y minus x? Minus x axis. 2, minus 2, 5, 5. OK, we get the example correct. I don't know. All right, we did day 9. It took 35 minutes. I don't know. Usually part 2 is like a lot harder. But this time, it was just very easy. We just extrapolated. And then we, I mean, it took a lot of explaining. But we extrapolate backwards. And then it just worked out. Well, I guess we're lucky sometimes. But it's also day 9. I feel like day 10, it's going to be harder again. Anyway, thanks for joining it. I think I'll call it a day then. And I mean, we've been doing double features, triple features. So it's nice to have one. That's just simple, right? Get add, get push. All right, the video for yesterday will be out in about three hours. And we had the creator of it as we come along. That's cool. It's going to be on the YouTube channel. And this video will be out in about 24 hours. All right, thanks for tuning in. Sometimes it's hard. Sometimes it's easy. But that's how life is. Thank you for tuning in. And see you tomorrow at the same time for more Android of code in Hustle. All right, bye-bye.