Challenging Ben Awad to Clash of Code

Поделиться
HTML-код
  • Опубликовано: 4 окт 2024
  • This week, I am challenging the one and only, Ben Awad, to a game of Clash of Code. Hope you'll enjoy it.
    Ben's channel: / 99baddawg
    Wanna learn the fundamentals of declarative Gestures and Animations? Check out start-react-nat....

Комментарии • 261

  • @neiker234
    @neiker234 4 года назад +204

    Marvel: "Infinity War is the most ambitious crossover event in history"
    Me:

  • @rhidlor8577
    @rhidlor8577 4 года назад +493

    watching this made me realize im a much better programmer than i thought

    • @iraklilekishvili7858
      @iraklilekishvili7858 4 года назад +36

      lol exactly Im good at solving problems but not so much at frameworks and stuff

    • @papabolmujhe7426
      @papabolmujhe7426 3 года назад +4

      Same here I would have solve those problems in less number of characters and much faster than them😂

    • @ernestas7126
      @ernestas7126 3 года назад +4

      Totally agree. I feels so much better about my skills now :D

    • @TheRealKitWalker
      @TheRealKitWalker 3 года назад +1

      😂 yeah.

    • @ko-Daegu
      @ko-Daegu 3 года назад +2

      @@iraklilekishvili7858
      But how would you get a job

  • @nowyouknow2249
    @nowyouknow2249 4 года назад +169

    There's a right tool for every job.
    Ben chose the right tool and won.

    • @captaincool6268
      @captaincool6268 4 года назад

      Burnn

    • @zyansheep
      @zyansheep 3 года назад

      Python is OP. JavaScript is confusing

    • @yaktd5704
      @yaktd5704 3 года назад +2

      @@zyansheep For assholes*

    • @ojasmaheshwari3862
      @ojasmaheshwari3862 2 года назад +1

      Actually cpp is the best for competitive programming.

    • @squ34ky
      @squ34ky Год назад

      @@ojasmaheshwari3862 it would've been a poor choice here.

  • @workscripts7496
    @workscripts7496 3 года назад +79

    If I ever feel bad about myself in programming I will just watch this.

    • @malonxos6069
      @malonxos6069 3 года назад +3

      Yeah... Like not passing from a codewars level 8 test for 3 days...

  • @jasonshen
    @jasonshen 4 года назад +109

    U still the best react native ui developer I ever seen

    • @wcandillon
      @wcandillon  4 года назад +14

      Thanks Jason 😅

    • @evke9007
      @evke9007 3 года назад +1

      @@suryadeveloper7139 everyone sucks in design

  • @parthabera8211
    @parthabera8211 4 года назад +61

    For 2nd problem, the trick is just to check if last two bits are zero, which can be done using bitwise AND. e.g.-
    if (n & 3) print("AAAAAAAA!") else print("Ok")

    • @vickylance
      @vickylance 4 года назад +2

      ooh awesome

    • @MrCh0o
      @MrCh0o 3 года назад

      Although you did swap the output here, AAAAA is for the number divisible by 4

    • @MChrisGM
      @MChrisGM 3 года назад +5

      Late reply but you can also do print(“A”*8+”!”) to reduce that even more

    • @simonc997
      @simonc997 2 года назад +1

      Genius.

  • @maabed1022
    @maabed1022 4 года назад +42

    Ben sipping his water while everyone is still clashing had me dying from laughter haha

  • @ward7576
    @ward7576 3 года назад +5

    That's why I don't do these - neither for practice, neither for job tests. They give such descriptions that you can read 10x, but you just don't understand either way.

  • @joshreynolds4164
    @joshreynolds4164 4 года назад +3

    What a gift! Two of my favourite devs to watch. This was so good to watch.

  • @chrismanning5232
    @chrismanning5232 3 года назад +47

    When you learn map() and try to apply it to literally everything...

    • @dscham1507
      @dscham1507 3 года назад

      But what is better for changing contents of a list? Maybe if it's an application that really needs the highest performance. Although I think languages other than Java are more efficient in that anyway. And they are so nice - simple, descriptive, nice to read. A hell to unit test though.

    • @cheat200
      @cheat200 3 года назад

      @@dscham1507 I actually tested the last question in python using the two methods: 1 - for loop, 2 - map and reduce. Using very many numbers and quite a few test runs I found that the "map, reduce" method was only ~2% faster. Probably because map and reduce don't seem to be able to work multi-threaded in python, at least in this case. So while there was a performance gain by using map and reduce, in my opinion, it was very negligible considering it made the code much harder to read than a nested for loop. After shortening them both and not including whitespaces, they were only 4 chars apart as well.

    • @dscham1507
      @dscham1507 3 года назад

      ​@@cheat200 I didn't phrase that very well, I actually meant that map reduce should be slower so I'm surpised it's actually faster. Must be nicely optimised in Python then. Java has the Stream API for that, which is definitely slower than a for.
      After some getting used to it, maps are much easier to read in my opinion. It's just functional (map) vs procedural (for) style.
      I don't know the name of that indian Java guru right now, but he explains very nicely why map is way better than for loops once you get used to it.

  • @aarongonzalez2879
    @aarongonzalez2879 3 года назад +13

    anyone else feeling real good about their programing ability after watching

  • @AdrianTwarog
    @AdrianTwarog 4 года назад +13

    This is so fun to watch!

  • @itsrubrub
    @itsrubrub 4 года назад +1

    Dream come true. I love both you and Ben and you guys made coding fun and hilarious to watch. Particularly loved seeing how you guys broke down the problems in different ways.

  • @radekluner4994
    @radekluner4994 3 года назад +25

    print("A"*8+"!!!") saves one character from print("AAAAAAAA!!!")

  • @lorkfongbot4683
    @lorkfongbot4683 4 года назад +1

    Enjoying this very much! Please make more like this

  • @binotmutum1974
    @binotmutum1974 4 года назад +2

    Programming just got whole lot more awesome... Love you guys....

  • @atinagg
    @atinagg 4 года назад +18

    is it too much to ask to make this type of content to be a series? 🥺 you guys are super fun to watch 💯

  • @HritikUtekar
    @HritikUtekar 4 года назад +3

    It was amazing....I'm wait for the next clash code. Enjoyed watching both of you.

  • @RaviSojitraJarvis
    @RaviSojitraJarvis 4 года назад +4

    This is the best and funniest video i have seen in a while!! Good editing by the way. 😆😂

  • @kayodeayelegun6279
    @kayodeayelegun6279 4 года назад +21

    This was super fun to watch 😂

  • @thisandthatguy1156
    @thisandthatguy1156 4 года назад +3

    So intense I felt the stress and its like watching a thriller lol. Nice editing btw.

  • @alexkey9372
    @alexkey9372 4 года назад +33

    Well you should challenge him in react native animations. im sure you will win!

    • @MiguelFelipeCalo
      @MiguelFelipeCalo 3 года назад +4

      You should challenge him in angular, he'll ragequit.

  • @ZALOP123
    @ZALOP123 3 года назад

    By far the best competitive programming video i've seen so far. Nice one

  • @obentabiayuk4780
    @obentabiayuk4780 4 года назад +2

    This is soo great, my best React Native devs challenging.... what der!!!

  • @naskar23
    @naskar23 4 года назад +2

    Absolutely Loved this .. you should do more of this :)

  • @KochharAmandeep
    @KochharAmandeep 4 года назад +11

    Answers in JavaScript, because I love JavaScript 💙
    1. const nums = ip.replace(/\./g,'').split('');
    const result = nums.reduce((acc, curr) => acc + +curr,0) * +nums[0];
    2. superlong % 4 === 0 ? 'Aaaahhhhhha' : 'Ok'
    3. students[(paragraphs % students.length) - 1]
    where students contains the list of student names and paragraphs contains the total number of paragraphs

    • @kevinschwuchow5979
      @kevinschwuchow5979 4 года назад +1

      I dont think your Solution to 3 would be right in Js, because when paragraphs==students.length then the modulo would be 0 and 0-1 = -1 which Js doesnt Support as Index, so it would be students[(paragraphs - 1) % students.length]

    • @KochharAmandeep
      @KochharAmandeep 4 года назад

      @@kevinschwuchow5979 Thank you for pointing this one out

  • @sid7294
    @sid7294 4 года назад +18

    From Clement's Google Coding Interview to this, where did I go wrong? ;(

  • @Aly_Fahmy
    @Aly_Fahmy 4 года назад +1

    This....... Is AWESOME!!!!! Holy shit we need more videos like this!!

  • @akromsprinter7067
    @akromsprinter7067 4 года назад +36

    I would love to see a clash between Ben and Coding Garden with CJ.

    • @vkray
      @vkray 4 года назад

      even with DT.

    • @akromsprinter7067
      @akromsprinter7067 4 года назад

      @@vkray sorry, but never heard of DT :)

    • @vkray
      @vkray 4 года назад +1

      Akrom Sprinter Donald Trump.

    • @pranjalagnihotri6072
      @pranjalagnihotri6072 4 года назад

      It will be awesome. But language should be same

    • @kevintlu
      @kevintlu 4 года назад

      300% :)

  • @kevinmarvincalda6929
    @kevinmarvincalda6929 4 года назад +1

    Love this kind of video 👍 thank you for sharing your knowledge to us beginners idol, I hope this channel will grow big

  • @alfredfx0
    @alfredfx0 4 года назад

    That was a lot of fun to watch! thanks William and Ben

  • @hank91918
    @hank91918 3 года назад

    you are a great sport Bill!

  • @AndrewGreenh
    @AndrewGreenh 4 года назад +24

    TypeScript is not the problem when you leave in hundreds of characters of comments in shortest mode 😜 (yes, comments count as do spaces and line breaks)

  • @bencroacademy
    @bencroacademy 4 года назад

    This was hilariously fun . Thanks guys. Great to see Ben here

  • @rajatgoyal8162
    @rajatgoyal8162 4 года назад +1

    You both guys are awesome 🤠🔥

  • @matthewvaccaro8877
    @matthewvaccaro8877 4 года назад +1

    For sure will need a rematch!

  • @wijaksanapanji
    @wijaksanapanji 4 года назад

    thanks for this videos! it's really fun to watch

  • @tuvshinbayartuvshinzul8489
    @tuvshinbayartuvshinzul8489 3 года назад

    It was really really fun to watch. you made my day :')

  • @jpisello
    @jpisello 3 года назад +7

    I definitely wouldn't use Typescript for this; I'd use Javascript and do everything with global variables (no var/let/const). That said, it's a bit unfair to compare code size between different languages.

  • @aaronnguyen7135
    @aaronnguyen7135 4 года назад +22

    When my 2 idols in one video. I can't believe this is real :D

    • @wcandillon
      @wcandillon  4 года назад +2

      haha Thanks Anh 🙌🏻

  • @OsamaQarem
    @OsamaQarem 4 года назад +2

    ben and william? my life is complete 🙌

  • @TheCaptOnix
    @TheCaptOnix 3 года назад +1

    Shortest solution to 8:16 I could think of in python is:
    from math import prod
    n = list()
    for s in input().split(' '): n.append(sum(map(int, list(s))))
    print(prod(n))

  • @mahmudsajib8648
    @mahmudsajib8648 4 года назад +1

    Haha. Pretty tough to win against someone who has Python under his belt 💪. Thanks to both of you btw.

  • @Lk-
    @Lk- 3 года назад +1

    Wow didn't know the guy from hot ones was a programmer.

  • @MultiWaveWave
    @MultiWaveWave 3 года назад

    You guys rock, awesome video! :)

  • @ammarranapur5917
    @ammarranapur5917 3 года назад +3

    6:30 When they tell you to print the answer so you print "answer" 😂😂

  • @usmansbk
    @usmansbk 4 года назад +2

    The crickets sound 🤣🤣

  • @itzpradip
    @itzpradip 4 года назад +3

    Wow! nice game love to see you both competing in a coding battle again, it was fun.

  • @akj7
    @akj7 4 года назад +8

    Wait a minute. Looking at how these guys solve these easy problems, i must be some sort of programming guru.

    • @KbIPbIL0
      @KbIPbIL0 3 года назад

      Oo yeah that lambda x: str(x)

  • @mancool450
    @mancool450 4 года назад +1

    Best RUclips crossover

  • @griseld
    @griseld 3 года назад

    First problem got me by surprise, i felt so stupid seeing him using arrow functions and stuff and i thought "ok he's gonna pull out some freaking way to do this in two lines of code while here i am thinking about solving it by splitting by dot and then taking individual digits in a for loop", then i saw the other guy doing the same thing and finishing first while he struggled and over complicated the code just to make it "quicker" and it felt reassuring that sometimes taking the short path takes you on a long journey. Sometimes you gotta just use the old simple way of programming and it also proves it's better being good at problem solving and logic than being a guru of ES6, knowing arrow functions and several different frameworks and languages, good problem solving ability and quick thinking is something you either have or don't have, syntax for quick coding you can find it on StackOverflow :)

  • @leeyahav4754
    @leeyahav4754 4 года назад

    good game
    like that a lot.
    Ben is a really fast thinker
    thnx for the video William

  • @favourcodes
    @favourcodes 4 года назад +1

    Awesome!!! My RN Faves in a video.

    • @wcandillon
      @wcandillon  4 года назад

      Hope you enjoyed it Ayobami 🙌🏻

    • @favourcodes
      @favourcodes 4 года назад

      @@wcandillon Yes, I did.

  • @yanisbenslimane3106
    @yanisbenslimane3106 4 года назад +4

    I love this type of video hhhh. Pas grave william tu prendra ta revenche un jour lol

  • @timgarcia4105
    @timgarcia4105 4 года назад +2

    BEN VS TECHLEAD PLS

  • @aldison5070
    @aldison5070 4 года назад +2

    Make more videos with Ben ! 🙃

  • @sairamareddypadala1328
    @sairamareddypadala1328 3 года назад

    after watching this video . . . well , i am not depressed anymore

  • @onen0zednine753
    @onen0zednine753 2 года назад

    In regard to the whole " why compare two different languages" bit, I could be wrong but I think the point is for the programmer to know which language to use to get the best result. If I am not mistaking, they have the option to chose at each round. The lesson being to learn more than one language when you see that your go-to language is more "wordy".
    The competition isn't between the languages, its between the programmers.

  • @davidjulitz7446
    @davidjulitz7446 3 года назад

    Coding under this kind of pressure is not easy. Well done.

  • @makisetakashi
    @makisetakashi 4 года назад +2

    your face going red William, hahaha so funny to watch

  • @AA-jb5cs
    @AA-jb5cs 4 года назад

    we're still waiting for the rematch

  • @ikeo8666
    @ikeo8666 3 года назад

    had to go fancy with the map reduce

  • @SheenaLumasoc
    @SheenaLumasoc 3 года назад +5

    watching this made me realize i should do better in my programming class😢 theres so much going on that it's not even discussed in our class.

    • @malonxos6069
      @malonxos6069 3 года назад

      Your comment made me realize I need to get on coding RIGHT NOW!!!

    • @raymartpamplona9122
      @raymartpamplona9122 3 года назад +1

      programming class in school teaches very little about programming itself. Be a self taught, have google things and don't rely on that "class" which teaches same stuff over and over again.^^

    • @JacobPilon
      @JacobPilon 3 года назад

      @@raymartpamplona9122 having seen a lot of code from both self-taught devs and graduates, I can tell you school doesn't teach you "very little about programming". Quite the opposite actually. Of course, there are some exceptions, but I'm speaking in term of majority.

    • @raymartpamplona9122
      @raymartpamplona9122 3 года назад

      @@JacobPilon well, it differs from where we study. Some school does teach more or more broader but some does not, and unfortunately i'm at the latter, that is why that is my concept. But hey, point taken and thank you for correcting me^^

  • @lifegrowth9389
    @lifegrowth9389 4 года назад +2

    Please Sir we are waiting for react native Fashion continuation...you are expanding my brain alot Sir... 😀😀

    • @wcandillon
      @wcandillon  4 года назад +7

      part 4 to 6 are dropping from tomorrow till Friday 🙌🏻

    • @lifegrowth9389
      @lifegrowth9389 4 года назад

      OK Sir thank you so much

    • @lifegrowth9389
      @lifegrowth9389 4 года назад

      @@wcandillon can I get a link for your courses where I can master react native perfectly as you do? And Skype for coaching..please Sir

  • @SpooksHD
    @SpooksHD 3 года назад

    as a clash of code regular it hurts to watch this and to have the different modes just ignored LOL

  • @ayyubayyyub9415
    @ayyubayyyub9415 4 года назад

    William is a monster he let Ben win the first time, then he demolished him later times.

  • @abebe8118
    @abebe8118 4 года назад +4

    Problems like that are indeed stressful, xD

    • @abebe8118
      @abebe8118 4 года назад +1

      you've done well wil :) cheers to you

    • @wulymammoth
      @wulymammoth 4 года назад

      favors those that have Leetcode'd recently

  • @איילהיינריך
    @איילהיינריך 3 года назад

    The difficulty of the questions is just funny

  • @pezo1919
    @pezo1919 4 года назад +11

    Who edited the video? Made me laugh many times.

    • @wcandillon
      @wcandillon  4 года назад +7

      That was super fun to edit. Quite a different format than usual :)

    • @pezo1919
      @pezo1919 4 года назад +1

      @@wcandillon Ah, that was you! :D Cool! :D Thanks, good to know! :D

  • @alinawaz4034
    @alinawaz4034 4 года назад +1

    love this

  • @tiagocunhafernandes6607
    @tiagocunhafernandes6607 4 года назад +1

    Lott of fun thank you for share!!!!!!

  • @FuzzyDunlopification
    @FuzzyDunlopification 4 года назад

    The bags under bens eyes are insane lol. He must spend many hours awake

  • @Adam-sm2xg
    @Adam-sm2xg 3 года назад +1

    12:48 Ben literally named the variable "thing". Been there, lol...

  • @josephdominguez1070
    @josephdominguez1070 3 года назад

    This is so dope

  • @darkmift
    @darkmift 4 года назад

    It was a good game nothing to be embarrassed about.

  • @brysonxiao947
    @brysonxiao947 4 года назад +1

    Lol I think the comments counted for the code length

  • @davidasiamah2898
    @davidasiamah2898 4 года назад +2

    This challenge had me laughing hard at midnight. Wow nice one guys we should see more like these.😁😂🤣

  • @fadilnatakusumah195
    @fadilnatakusumah195 4 года назад

    damn smart people challenging each others

  • @ahtisham6597
    @ahtisham6597 3 года назад +1

    I took a different approach:
    ip = input()
    parts = ip.split(".")
    port = 0
    for part in parts:
    q = 1
    part = int(part)
    while q > 0:
    q = part // 10
    r = part % 10
    port = port + r
    part = q
    port *= int(parts[0][0])
    print(port)

  • @SpeedingFlare
    @SpeedingFlare 3 года назад

    Perfect example of tortoise and the hare 😂

  • @alexanderguizar4082
    @alexanderguizar4082 4 года назад +1

    Sean here, with First We Feast

    • @wcandillon
      @wcandillon  4 года назад +1

      I discovered this show last week and became a fan :)

  • @santech5669
    @santech5669 3 года назад +2

    These guys make me feel good about myself 😂

  • @jasonennis4905
    @jasonennis4905 4 года назад

    I love this

  • @anndries
    @anndries 3 года назад

    last task in js. js rules!)
    a.split(' ').reduce((a,v)=>a*eval(v.split('').join('+')),1)

  • @nomaddev8693
    @nomaddev8693 3 года назад

    5:37 I'm screaming at the screen "NOOOO BENNN!!!"

  • @muhammadowais9661
    @muhammadowais9661 4 года назад

    Ben is love

  • @alkhiljohn3813
    @alkhiljohn3813 2 года назад

    2:36 My man goin for O(n^2) :')

  • @arnabpersonal6729
    @arnabpersonal6729 3 года назад

    Nothing can beat python in string manipulation

  • @withpratap
    @withpratap 3 года назад

    I really enjoy watching coding clash.

  • @johnhaupenthal
    @johnhaupenthal 4 года назад +1

    This was hilarious guys!

  • @TheRijintube
    @TheRijintube 3 года назад +1

    I dont know if this is correct, but I think the first one can be solved like this:
    ip=list(map(int, list(''.join(input("IP:").split(".")))));print(sum(ip)*ip[0])

  • @Chrosam
    @Chrosam 4 года назад +1

    Four .filter and 2 .map, hmm.. ok

  • @kartiknighania8588
    @kartiknighania8588 3 года назад

    how do u create such kickass B roll intros!!!! ?

  • @olalekansogunle
    @olalekansogunle 4 года назад

    Since I love ruby. I felt like dropping this one liner for the last problem here. Maybe the shortest solution exists in Ruby.
    `input_array_list.split(' ').map{|str| str.split('').map(&:to_i).sum}.inject(:*)`

  • @SowedCastelli
    @SowedCastelli 4 года назад

    😂 😂 😂 😂 😂 😂
    Ohhh God! Oh my God! Oh God. 😅😅😅
    This is soooo much fun. Please keep creating such content.

  • @vishvajeetsingh9843
    @vishvajeetsingh9843 4 года назад

    Nice Match.
    Would be great if you two could make something on React Native.

  • @droidmakk4968
    @droidmakk4968 4 года назад

    This helping me a lot... Thanks much ❤️

  • @DiscipleW
    @DiscipleW 4 года назад +2

    Where are the hot chicken wings

    • @wcandillon
      @wcandillon  4 года назад +1

      haha I discovered the hot ones last week and I've been binding on this show like crazy. even ordered the hot sauces from the show 😂

    • @DiscipleW
      @DiscipleW 4 года назад +1

      @@wcandillon Sorry for the above odd comment. You just really reminded me of the leading man in the show

  • @willyrosahuanca696
    @willyrosahuanca696 4 года назад +1

    competitive programming oww You are there too. Codingame.

  • @abcd1to
    @abcd1to 3 года назад

    So looking from the comments we all spent too much time on project Euler and leetcode