Challenging Ben Awad to Clash of Code

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello reactive developers I hope you are well William here recording from beautiful Zurich Switzerland today I am challenging been Awad to a game of clash of cod I don't like my chances I think it's gonna be very embarrassing for me but I don't think you can use vim binding in clash of cuts so that might give me a chance let's have a look alright so I'm about to be facing off against William here and it's good when you're about to go into a heated mash to get your mind set in the right place so right now I am just envisioning William as an angular dev so let's go you have to pass maximum test possible you have a special IP address you must enter the open port you don't have so much time to scan all the ports but you know the open port is equal to the sum of the digits not the numbers what so we're gonna split our characters will reduce and number index start at zero if index is 1 we multiply if index is zero we wait so that US we add something like this oh what the heck this is the easiest problem in my life just IP dot bye we're doing this in Python guys I thought I was going to need to do this and oh my gosh what the heck is this why is this easiest my life so parts I'm surprised no one else has finished it yeah first part equal two parts zero and then we're just going to loop through all the parts so for part and parts and we need to then split it by each character so for letter in the park and then we need to parse each one as an INT and we just need to add it to the sum so sum is zero by all first all single letters here guys and we just add that and then we multiply it times the first letter which is first part and then we need to get the first letter of the first part make then and I need to be I need to be invent and should print s come on come on go go guys guys where am I my winning or losing here hey let's go first place why you guys going so slow I guess I need to split by characters to details one which are dots and parcel number so maybe I should skip the first number if I equals zero I return zero we add the rationals and then I do I take the first number you and I multiply oh my gosh is done already come on come on Plus I am just embarrassing myself this is terrible okay looks good I submit you got there oh my gosh she's writing in typescript that's a mistake that's a mistake right there all right let's do this round two shortest murder print okay if the Super Nintendo and is not the V divisible by far okay so n is divisible by four not four equals zero print is not divisible / okay if it's not divisible and this if it is what the heck is this problem I hate this problem this is not a problem okay I don't I just submit I'm not even gonna do play test cases and modulo 4 equals zero okay and I guess I need to create into a console log SPR somehow no I'm actually tilted because I think oh I lost a loss because of this I think I went for the kill by not running test cases and then I just I just killed myself in an elementary school the teacher is making all the students tech town in reading a story this is done by assigning the students in a first to last list then having each side raise the next paragraph of the story if every student has read the order of students reading repeats from the beginning of the first to the last list until the story is completely read that for example is the first to last list is of three students Jimmy Joe and Jason and the story is five paragraphs long the reading session would go like Jimmy paragraph one Joanne parve - Jason Farah free Jimmy para 4 J 1 para 5 your aim is to find the child who read the last paragraph of the story so we have the names and a please the number of paragraphs I guess I wonder I'm pretty sure I'm just supposed to do mod to figure this out by the way is how you do this so I want to do an array which is a length of P so P is a number of paragraph we map [Music] returns index and now I want I need the array of names and now I want to map graph so I'm going to go to name I modulo of names dot length and I should take the last one here let's place a test cases looks good should I submit now should I wait for looks good looks good and I said bended and submitted yet so so P is the number wait n is a list of n names I'm so confused a few moments later ok so here are the names I had this problem and then I got really confused for no reason so the length of names divided by and and what is n so P is 20 this is 3 is I don't care about and I only care about P it gets this and we just lost to somebody we can see it on the left found nothing list index out of range but we modded it minus 1 maybe when in doubt off by one error so Bennie stick lashing about how short is this gonna be I hate my life why why why did I get myself this problem if if V is equal to zero V is now equal to the length of names - one I'm not quite sure this is this is good you think about this holistically for a second maybe I need to do the length of names - minus one so this is now zero and now mod that that I kidding okay that's my problem there here we go there's a gate this is actually just a disaster oh no linkage I just I just wanna I just need to go next I just need to go next oh my goodness oh my goodness all right so we lost by half the time - William on this one he is way more characters than us he's using typescript oh that's probably it okay I think I really misunderstood the instructions I tried to submit something as quick as possible but obviously damn it I lose again oh wait I actually won okay so I really misunderstood the instructions that I thought time was still in play but obviously no you you have time if you can make it shorter uh I'm such a noob but okay let's let's have a rematch [Music] fastest mode gift passing fast as possible given two numbers a and B you have account how many numbers within a range belong to the following categories multiples of a but not B multiples of B but not a multiples of both either for example okay the number account okay a and B what so for I and range s to e and this is inclusive oh man start stop is exclusive which means I need to add one I think so okay so we're going to just go through the range here and then we have group okay thing zero zero zero zero zero zero so this is our output and then we're just going to print thing and then we're trying to join it by a space here this is this one is gonna be like that and then here we're just gonna have a bunch of if statements if divisible by a if I mod a and I mod B are both equal zero then I need to say thing multiples of both is the third array so that's two plus equal one if I mod a is equal to zero thing zero one if I mod B is equal to zero thing multiples of B but not a plus equal one and if all of these this is gonna be an LF L of else thing yeah three plus equal one and they test cases really nothing expected a string instance I have to make these into strings that's really annoying I forget how to map over this all right this is this couldn't lose it for me guys but we're gonna go for a map because I feel like being cool X can't remember right syntax STR X maybe like that let's go [Music] excellente meanwhile so you are a - s okay and now I guess we just do a filter so we have see one it's gonna be so for each now what am I doing here actually it's I plus start so we filter if I modulo a equals zero and I modulo e is different from zero and then see two it's yours over one so B a and C three multiples of both perfect and none of the above this been done already someone seems to be done already come on come on and then console.log oh my gosh is killing me c1 c2 and c3 lengths this is so stressful being so stressed in my life oh my gosh let's run some test cases wondering right well I'm on break here so what I think is gonna screw up a lot of people is just they didn't put the plus one in the range one eternity later so inclusive so plus one [Music] okay Wow let's see if I got it correctly yes good game man good game what can I say I came to play given a string of space separating number calculate the product of all the sums of the digits of each number so for a and X 4 so it's added and multiplied okay so four we're just going through each digit and this is a local some and ever just say local sum plus equal and the integer of B and then s multiplied times the local sum and then we're going to print s so we're going to split by space and then so we're gonna map to a number and now we need to do a reduce so accumulation and element and we we multiply these elements so it's eight times so should maybe be one here a times e but e we need to get the sum of e so we are going to split huh so maybe this one we keep we don't do the pass into here so we split e we pass and maybe can I do is pass in directly to save character and this one we need to pass int and we need to do the sum here so reduce zero a a plus something like that just let you see if this is right no wait valid literal for for a and X being a split this one okay they've literally split every single string for me but this one they're like nah fam all right so we can code golf this we can subtract this by one so we're gonna call him Q and I mean I don't see how we're getting much shorter here I think we're just going to call this good all right we did not test it let's test it real quick does not speed contest [Music] our guys 129 characters beat that but now if I have to fight typescript a loss this is gonna be okay so let me go back to one a pass int and this was like a callback to a string okay okay so Ben is done okay so only thank for a second how would I make this smaller I don't know this is there's probably something so I want to do pass hint of a here we have a string IRA Williams really tanky on this one yeah he still he's still going why is he complaining here one eternity later choose a plus but actually it doesn't sound too bad let me just do pass int of e converted as a string let's see what types you can do for us here is it because of this guy here because Keir can probably make it shorter I feel like he's gonna lose cuz he just has to have Const everywhere or I guess he's gonna use a lot so you can have minus one characters and we make it even shorter I don't know I mean can we does this count it removes the I don't know good enough for me you tried so hard to the reduce his limit okay so this is pretty Shane hood been crushed me completely but yeah for sure was a lot of fun and the I stress food as well but I hope I'm gonna train and I hope I can get my rematch against Ben but Ben good game [Music]
Info
Channel: William Candillon
Views: 103,370
Rating: 4.933135 out of 5
Keywords: TypeScript, Clash of Code, Python, React, React Native, AngularJS Rulz, Ben Awad, Good Game
Id: Aoy2MRvYK2A
Channel Id: undefined
Length: 25min 0sec (1500 seconds)
Published: Tue Jul 14 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.