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....
Marvel: "Infinity War is the most ambitious crossover event in history"
Me:
😁
watching this made me realize im a much better programmer than i thought
lol exactly Im good at solving problems but not so much at frameworks and stuff
Same here I would have solve those problems in less number of characters and much faster than them😂
Totally agree. I feels so much better about my skills now :D
😂 yeah.
@@iraklilekishvili7858
But how would you get a job
There's a right tool for every job.
Ben chose the right tool and won.
Burnn
Python is OP. JavaScript is confusing
@@zyansheep For assholes*
Actually cpp is the best for competitive programming.
@@ojasmaheshwari3862 it would've been a poor choice here.
If I ever feel bad about myself in programming I will just watch this.
Yeah... Like not passing from a codewars level 8 test for 3 days...
U still the best react native ui developer I ever seen
Thanks Jason 😅
@@suryadeveloper7139 everyone sucks in design
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")
ooh awesome
Although you did swap the output here, AAAAA is for the number divisible by 4
Late reply but you can also do print(“A”*8+”!”) to reduce that even more
Genius.
Ben sipping his water while everyone is still clashing had me dying from laughter haha
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.
What a gift! Two of my favourite devs to watch. This was so good to watch.
When you learn map() and try to apply it to literally everything...
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.
@@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.
@@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.
anyone else feeling real good about their programing ability after watching
This is so fun to watch!
Thanks Adrian 🙌🏻
Ayy didn't think I would find you here !
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.
print("A"*8+"!!!") saves one character from print("AAAAAAAA!!!")
Enjoying this very much! Please make more like this
Programming just got whole lot more awesome... Love you guys....
is it too much to ask to make this type of content to be a series? 🥺 you guys are super fun to watch 💯
It was amazing....I'm wait for the next clash code. Enjoyed watching both of you.
This is the best and funniest video i have seen in a while!! Good editing by the way. 😆😂
This was super fun to watch 😂
Glad you enjoyed it 🙌🏻
m8+
+
So intense I felt the stress and its like watching a thriller lol. Nice editing btw.
Well you should challenge him in react native animations. im sure you will win!
You should challenge him in angular, he'll ragequit.
By far the best competitive programming video i've seen so far. Nice one
This is soo great, my best React Native devs challenging.... what der!!!
Absolutely Loved this .. you should do more of this :)
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
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]
@@kevinschwuchow5979 Thank you for pointing this one out
From Clement's Google Coding Interview to this, where did I go wrong? ;(
This....... Is AWESOME!!!!! Holy shit we need more videos like this!!
I would love to see a clash between Ben and Coding Garden with CJ.
even with DT.
@@vkray sorry, but never heard of DT :)
Akrom Sprinter Donald Trump.
It will be awesome. But language should be same
300% :)
Love this kind of video 👍 thank you for sharing your knowledge to us beginners idol, I hope this channel will grow big
That was a lot of fun to watch! thanks William and Ben
you are a great sport Bill!
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)
This was hilariously fun . Thanks guys. Great to see Ben here
You both guys are awesome 🤠🔥
For sure will need a rematch!
thanks for this videos! it's really fun to watch
It was really really fun to watch. you made my day :')
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.
When my 2 idols in one video. I can't believe this is real :D
haha Thanks Anh 🙌🏻
ben and william? my life is complete 🙌
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))
Haha. Pretty tough to win against someone who has Python under his belt 💪. Thanks to both of you btw.
Wow didn't know the guy from hot ones was a programmer.
You guys rock, awesome video! :)
6:30 When they tell you to print the answer so you print "answer" 😂😂
The crickets sound 🤣🤣
Wow! nice game love to see you both competing in a coding battle again, it was fun.
Wait a minute. Looking at how these guys solve these easy problems, i must be some sort of programming guru.
Oo yeah that lambda x: str(x)
Best RUclips crossover
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 :)
good game
like that a lot.
Ben is a really fast thinker
thnx for the video William
Awesome!!! My RN Faves in a video.
Hope you enjoyed it Ayobami 🙌🏻
@@wcandillon Yes, I did.
I love this type of video hhhh. Pas grave william tu prendra ta revenche un jour lol
BEN VS TECHLEAD PLS
Make more videos with Ben ! 🙃
after watching this video . . . well , i am not depressed anymore
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.
Coding under this kind of pressure is not easy. Well done.
your face going red William, hahaha so funny to watch
we're still waiting for the rematch
had to go fancy with the map reduce
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.
Your comment made me realize I need to get on coding RIGHT NOW!!!
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.^^
@@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.
@@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^^
Please Sir we are waiting for react native Fashion continuation...you are expanding my brain alot Sir... 😀😀
part 4 to 6 are dropping from tomorrow till Friday 🙌🏻
OK Sir thank you so much
@@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
as a clash of code regular it hurts to watch this and to have the different modes just ignored LOL
William is a monster he let Ben win the first time, then he demolished him later times.
Problems like that are indeed stressful, xD
you've done well wil :) cheers to you
favors those that have Leetcode'd recently
The difficulty of the questions is just funny
Who edited the video? Made me laugh many times.
That was super fun to edit. Quite a different format than usual :)
@@wcandillon Ah, that was you! :D Cool! :D Thanks, good to know! :D
love this
Lott of fun thank you for share!!!!!!
The bags under bens eyes are insane lol. He must spend many hours awake
12:48 Ben literally named the variable "thing". Been there, lol...
haven't we all XD
This is so dope
It was a good game nothing to be embarrassed about.
Lol I think the comments counted for the code length
This challenge had me laughing hard at midnight. Wow nice one guys we should see more like these.😁😂🤣
damn smart people challenging each others
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)
Perfect example of tortoise and the hare 😂
Sean here, with First We Feast
I discovered this show last week and became a fan :)
These guys make me feel good about myself 😂
I love this
last task in js. js rules!)
a.split(' ').reduce((a,v)=>a*eval(v.split('').join('+')),1)
5:37 I'm screaming at the screen "NOOOO BENNN!!!"
Ben is love
2:36 My man goin for O(n^2) :')
Nothing can beat python in string manipulation
I really enjoy watching coding clash.
This was hilarious guys!
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])
Four .filter and 2 .map, hmm.. ok
how do u create such kickass B roll intros!!!! ?
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(:*)`
😂 😂 😂 😂 😂 😂
Ohhh God! Oh my God! Oh God. 😅😅😅
This is soooo much fun. Please keep creating such content.
Nice Match.
Would be great if you two could make something on React Native.
This helping me a lot... Thanks much ❤️
Where are the hot chicken wings
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 😂
@@wcandillon Sorry for the above odd comment. You just really reminded me of the leading man in the show
competitive programming oww You are there too. Codingame.
So looking from the comments we all spent too much time on project Euler and leetcode