Can Harvard Students Solve This Coding Question For $100?
We traveled to Cambridge, Massachusetts, home of Ivy League Harvard University to see if the students on campus could solve our coding challenges. If they do, they win $100.
Music from @mynamecuey
OnCue - No Setbacks
OnCue - Leap of Faith
OnCue - GOOFY WHITE BOY
Business Inquiries:
contact@kgunderman.com
Resources:
----------------------------------------------------------------------------
My Top Recommended Udemy Courses: bit.ly/3IDTiLw
Socials:
----------------------------------------------------------------------------
Subscribe: www.youtube.co...
Instagram: / kennygunderman
Twitter: / kennygunderman
Filming gear used in this video:
----------------------------------------------------------------------------
Camera (Canon EOS R6): amzn.to/31AkBVd
Lens: amzn.to/3BZWj3z
Drone: amzn.to/3kLLFrk
Gimbal: amzn.to/2YhUEZ5
Shotgun Mic: amzn.to/3q7zrwD
Timestamps:
----------------------------------------------------------------------------
Intro to Harvard: (0:00)
Computer Science Trivia: (0:16)
Flatten 2D Array: (1:57)
Computer Science Trivia 2: (3:16)
MIT bros destroy my coding problems: (4:47)
Coding and... Milk?: (7:47)
Consecutive Zeros: (8:11)
Пікірлер: 1 300
Make sure to check out Nick’s video for more students taking on our coding challenges: kzread.info/dash/bejne/lGuHrK2hmdHYgbQ.html
@iftekharhossen7221
2 жыл бұрын
Hey bro HTML is not a programming language it is a Markup language
@NazriB
2 жыл бұрын
Lies again? Redeem Code
@harmanjeetsinghkhangura7742
2 жыл бұрын
PS: HTML is not a programming language.
@sknashimakram2493
2 жыл бұрын
Please do a online contest.. Make the question moderate level.. Please
@jesusmarin5423
2 жыл бұрын
Haha they get bigger, The wrong numbers, I'm a math student and I see the numbers are wrong and a mistake! Greetings!
When she realize that html is not programming language still she got 100 bucks.
@saadmayo8822
2 жыл бұрын
I think instead of HTML php would be in this list..
@iorekby
2 жыл бұрын
I mean, you think the name would give people a clue lol: HyperText *Markup Language*
@saadmayo8822
2 жыл бұрын
@Dughn No it's a markup language used in front-end work..
@saadmayo8822
2 жыл бұрын
@Dughn not is not a language..
@sujit_ghimire
2 жыл бұрын
@Dughn Chinese is a language. Don't mean it's a programming language
So we're just gonna ignore the fact that a HARVARD STUDENT called HTML a programming language?
@series1054
2 жыл бұрын
Same here buddy.
@hilmidwiputranto6944
2 жыл бұрын
would you be mad if I call matlab a programming language
@Gamming97
2 жыл бұрын
hahahaahaha and SQL is not a programming language xd
@jammy2003
2 жыл бұрын
@@hilmidwiputranto6944 yes coz indexing in shitlab starts from 1.
@-steady-8215
2 жыл бұрын
@@jammy2003 wow. Is this a criteria to qualify as a programming language? ¯\_(ツ)_/¯
Give the students JavaScript or CSS problems and you’ll probably save a couple bucks🤣
@yaredhaile9322
2 жыл бұрын
That's what I'm saying! He's asking them questions HS students could answer LOL
@ianramosYT
2 жыл бұрын
Is JS actually harder than these questions?
@AdrianArturoMora
2 жыл бұрын
@@ianramosYT depends, a lot of college students learn backend development and so these questions are a walk in the park for most of them. While JavaScript and CSS is more frontend and so they will have more trouble trying to solve it since a lot of universities don’t teach it.
@panthbarola1256
2 жыл бұрын
@@ianramosYT Technically it shouldn't be as backend requires logical solutions but then you learn backend all throughout highschool and use ides which complete your statements for frontend (my case). I've studied Java for 5 years, Python 1 and no front end at all.
@roshantadadikar2118
2 жыл бұрын
Ikr 😂
Should've asked me a question....or just given me $100
@kennygunderman
2 жыл бұрын
I got you next time bruh
@phoenixxam5812
2 жыл бұрын
Hi cole
senior as CS major here in the US - pretty cool to test my knowledge against theirs. they sure were such a good sports for actively participating & cracking the problems in no time!
@mod2
2 жыл бұрын
I mean these were pretty easy problems for a CS major
@ghostbravo7127
2 жыл бұрын
I am a molecular geneticist, I don't even program (outside of some scientific modelling, statistics and other analysis work from time to time but I'm still usually just looking over a data engineer's work and making sure they didn't do anything that will piss off my bench scientists), that being said it took me around 15 seconds to solve each problem (outside of some history questions.) He needs to up the difficulty a bit so he stops losing all that cash.
1:47 damn that missed high five😢 did no one notice that?
@AmmoBops
2 жыл бұрын
Lol seen that 😂
@knowledge21930
2 жыл бұрын
Lmao how'd I miss that... It's way too hilarious
@pf6875
2 жыл бұрын
F
@TitaniumTronic
2 жыл бұрын
F 💀
The MIT guy did well elaborating because if I were the one, I'll just use *set*. And automatically, it'll remove duplicates.
@god_gaming178
2 жыл бұрын
Me too .I thought he would do the same.but he picked that way
@noelcovarrubias7490
2 жыл бұрын
Yeah but he gave the most simple answer, no one would use an algorithm with that time complexity lol
@TomRaf
2 жыл бұрын
I'd use a linq method distinct in c#, all in one row, sorted...
@ziga1122
2 жыл бұрын
or if its mandatory to keep it in the list you can just do list(dict.fromkeys(name of the list))
@Sushank777
2 жыл бұрын
@@ziga1122 i guess distinct method only works on pair value, which isn't the case here! I'm not sure i might be wrong
If you wanted to go even further with this, get a 2015 or old MacBook Pro, a portable monitor, and load up VS code. Tell them they can use any language they want to solve the problem. I think that would add another level of difficulty since syntax would be forced and they’d work under pressure; plus, I’m sure you guys would save a few hundred bucks lol Great series ✊ Oh! You could see if they got the right answer too! That’s another plus!
@kennygunderman
2 жыл бұрын
Haha i actually had this idea because I have an old macbook but maybe next time 🤣🤣
@Landon_Hughes
2 жыл бұрын
@@kennygunderman nice 😎
@mosk11tto
2 жыл бұрын
@@kennygunderman Please this, would be cool to see how it turns out.
@HiHi-ek1dd
2 жыл бұрын
Nice
Isn’ t the max value 2^32-1?
@phungaoxuan1839
2 жыл бұрын
Right? I thought so too
@shrey9660
2 жыл бұрын
65535, ye
@vitor.araujo25
2 жыл бұрын
2^32 equals more than 4 billions, 65535 is 2^16-1
@vinayemani4105
2 жыл бұрын
Yes, for unsigned 32 ints, it is. For signed integers, it's 2^31 - 1.
@michaelhuang8347
2 жыл бұрын
About the comment this too lmao
i started smiling around the timr when the first group of girls were listing 10 languages and i noticed at the end of the video that my smile hadn't broken at all ☺️ loved this one.
@TitaniumTronic
2 жыл бұрын
Was smiling til she said HTML
Isn't HTML a Markup language which is not a programming language I think so
@kirkislas4320
2 жыл бұрын
If someone from MIT says it’s a programming language, we should accept it because they are smarter than us because we do not go to MIT and they do
@iorekby
2 жыл бұрын
@@kirkislas4320 Oh, best and brightest in the likes of MIT and the Ivies. Always. For sure. No one has ever gotten in there because their rich parents "helped" those universities build some new faculty offices. That would neeeveeerrr happen.
@jamesbedukodjograham5508
2 жыл бұрын
@@iorekby Yeah the Ivy Ivy League has always attracted the very best students from all around the world. Wow I am really impressed by the Intelligence of the MIT students. They are among the brightest I have seen.However most of them tend to neglect China India and Africa where also bright Brains live and thrive a lot all the time.
@TheWorldOfLokalnub
2 жыл бұрын
Yeah.
@zxcvbnm5758
2 жыл бұрын
@@kirkislas4320 I'm dead
You know that studying programming really paid off when a random stranger asks you to write a code to win money.
Those questions were too easy dude. Anyone can solve it. I was expecting some binary tree, linked list, graphs with some decent algorithms. Those questions were a steal for $100
@rustyshackleford2469
2 жыл бұрын
Are dank cp coder average striver fanboy bas kar bhai video banana hai wider audience ko reach jaani chaiye
@AdityaChaudhary1998
2 жыл бұрын
@@rustyshackleford2469 lmfaoooooo XDDD
@solidcricket
2 жыл бұрын
Do u really believe 20k ppl will watch a video where question realted to Tree are asked ? I know i wont
@rustyshackleford2469
2 жыл бұрын
@@solidcricket preach my brudda
@TheSoulCrisis
2 жыл бұрын
Actually a ton of people would miss those questions, especially at lesser ranked schools. That's why he got Harvard and MIT people probably. lol
Since I finished a test today and have some free time, I also wanted to try these questions 😅 Here are my answers: 🔸Sum of all values and also the creation of a new array with all the subArrays [Python] arr = [[1,2,3],[4,5],[6]] value = 0 for x in arr: for y in x: value = value + y print(value) newArr = [] for x in arr: for y in x: newArr.append(y) print(newArr) 🔸Remove duplicates and return a list [Python] arr = [1,1,2,2,3,4,4,4,5] print(list(set(arr))) 🔸Instead of threeSum method, I also added twoSum and uniqueValue to this code, to return all possible combinations [Python] arr = [5,4,2,1,5,8] sum = 5 for i in arr: if i == sum: print(i) for j in arr: if i != j and i+j == sum: print(i,j) for k in arr: if i != j and j != k and i+j+k == sum: print(i,j,k) 🔸Multiply array [As I wanted to use a built-in function, I went to Javascript] arr = [1,2,3,4,5] console.log(arr.reduce((x,y) => x*y)) 🔸Sequence of zeros in a binary input. [Python] arr = '101010100001000000110'; word = ''; value = 0; for i in arr: if i=="0": word = word + i if len(word) > value: value = len(word) elif i=="1": word = '' print(value) //Yes, I considered a string in matter of fact rs I hope these are right, with quick tests I got good results. Greetings from Brazil!!
@-steady-8215
2 жыл бұрын
I love python.
@tabi9469
2 жыл бұрын
Spaghetti code but it works so good on ya
@varunshrivastava2706
2 жыл бұрын
All these questions are really really easy for some one who is pursuing bachelor's in cse.
@msinna6433
2 жыл бұрын
@@varunshrivastava2706 ok.
@sachitagarwal8940
2 жыл бұрын
Bro are there ways to earn with coding and everything around like web and all alone with a primary job. I never had the opportunity to learn coding but I am very much interested to begin now that am completely free after working hours since the work pressure is very less.
4:38 my life with stack overflow
he didn't have to do a three nested for loop, he could have done a two pointer implementation
@pawelpow
2 жыл бұрын
Exactly, these people are not what I have in mind when I think of “Harvard students”, not saying that they aren’t “intelligent” but I am underwhelmed
@sankhya_0461
2 жыл бұрын
@@pawelpow Maybe they havent gotten that far into coding? Freshers maybe. But yeah, that solution to threesum was trash. n^3 complexity is unacceptable.
@joshurlay
2 жыл бұрын
@@sankhya_0461 They are definitely in their first year. I feel it in my bones. Also, I just finished my first python course in Uni. I believe any of these problems can be easily done, but that doesn't mean they are acceptable. I can hear leetcode yelling at me for runtime errors already over the three sum. I wanna get them but I think I'd just need some basic data structures knowledge.
@tisaname8490
2 жыл бұрын
It was an aerospace engineer 🤷♂️
@yaroslavluchko8492
2 жыл бұрын
bro got paid either way 🤷
Where should we go next?
@yassser123
2 жыл бұрын
Try med students
@mulengandalama9986
2 жыл бұрын
A meetup
@gabrielfelixdossantos3099
2 жыл бұрын
Stanford!!
@girishnair546
2 жыл бұрын
Georgia Tech
@f0urO4
2 жыл бұрын
Come to mexico! Tijuana Revolucion And see who can crack code challenges!
First off, the integer question is vague, if you meant signed integers which most programing languages abriviate as int, the max value is 2^31-1, but still if you asked for unsigned (which when coding you must specify) the value is still not 2^32 rather 2^32-1. You could say the question was asking about the maximum for all 32b integer types but nevertheless I find it important. Second, sorry, but for the giga and terabytes you're outright wrong, tera is 10^3 (1000) of a giga value so there are a 1000 gigabytes in a terabyte. You probably mistook it for tebibyte and gibibyte abriviated as TiB and GiB for which the difference in value is actually 2^10 or 1024. Good thing I wasn't in the video I would've gotten those things wrong haha.
@anonym8587
2 жыл бұрын
I was looking for a comment saying that terra = 1000 giga and i took a long time. Finally someone!
@Exachad
2 жыл бұрын
@@anonym8587 Exactly. I instantly saw the HTML blunder in a thousand comments. Decided to scroll down a bit and then finally saw some comments talking about his integer blunder, but had to scroll down so much more to find one comment about the gibibyte and tebibyte blunder.
@maximmounier6716
2 жыл бұрын
Its actually 2^31 - 1 because we start count bits at 0, so the 32nd one is at 2^31
@BigMiner3000
2 жыл бұрын
@@maximmounier6716 you're right, my bad I typoed, fixed it.
@mehdiaberkane5621
2 жыл бұрын
for real
for the remove duplicates one, you could technically just convert it to a set and then convert it back to a list in python
@mizaelparedesvielma8221
2 жыл бұрын
Also in JS
@gajtan7086
2 жыл бұрын
Yep
@benjaminpike
2 жыл бұрын
you'll lose the order of the numbers though because sets are not indexed
@samuelwittlinger7790
2 жыл бұрын
You could just sort the list and iterate through pairs of values, adding unique ones to the list, which is faster than a nested loop. Was actually surprised that an MIT student wouldn't give this solution.
@saibie3120
2 жыл бұрын
@@benjaminpike dicts are (now) so I'd probably use this instead and then list(d.keys())
sheeesh.....MIT and Harvard kids are intellects. Even an Aerospace engineer can pretty much solve a leetcode medium in a heartbeat LOL
@blank-yk1rd
2 жыл бұрын
The solution was not at all efficient though. But can exempt that for a non cs person.
@toekneema
2 жыл бұрын
@@blank-yk1rd yea agreed. N^3 wouldn't be very impressive if he were a CS student
@TheSoulCrisis
2 жыл бұрын
High level logic, problem solving, and engineering are very transferrable skills is why
@globist9527
2 жыл бұрын
@@blank-yk1rd Only people that took a CS class could solve it, lol.
I'm first year software engineering student and I'm in my first semester. I ain't a Harvard student but ISTG I solved all of them. Feeling happy and proud of myself ♡
@dLzzzgaming
2 жыл бұрын
Good shit man!
@huskymotivations
2 жыл бұрын
@@dLzzzgaming thanks man i appreciate it
@dLzzzgaming
2 жыл бұрын
@William Xei way to shit on someones cake dog.
@Remonade-
2 жыл бұрын
@William Xei always has to be that one person trying to put others down
@laur-unstagenameactuallyca1587
2 жыл бұрын
well done buddy 🤗 project idea: try to solve the last one recursively without having a sum variable outside of the recursive function's scope
For the duplicate in python: def remove_duplicates(lst): return list(set(lst)) For the 3 sum: wrong because he multiplies the indexes, not the elements def three_sum(lst): for i, a in enumerate(lst): for j,b in enumerate(lst): for k, c in enumerate(lst): if i != j != k: return a,b,c
@shaco2731
2 жыл бұрын
Wrong. The question is to find 3 numbers that make up a certain number. But three nested loops dont do shit if the argument is always len(list) since they will all start from the same element the answer could come to be the same number that is essentially on the same index(if result has to be 12 and first or xth element is 4, it will return [4,4,4] instead of combination of different numbers.).
@hexailon
2 жыл бұрын
@@shaco2731 indeed
I'm confused weren't some of these answers wrong? I thought Java originally came out in 1995 and that to calculate the maximum number for an x-bit integer you would do (2^x) - 1, so for a 32-bit integer would be (2^32) - 1 not (2^32)
@pinheadlarry2209
2 жыл бұрын
i'd say it's (2^31)-1 assuming it's not an unsigned integer
@deniskovalenko2951
2 жыл бұрын
I agree that the max possible value is 2^31-1 since integers are signed by default in most languages. 2^32 - 1 is also acceptable for unsigned, but 2^32 is just a yikes.
@breq8079
2 жыл бұрын
If you have 32 bits where each bit is representative of 2^i, ranging from i=0 through i=31, then the resulting sum is equivalent to 2^32 - 1. Also, technically speaking, his saying "integer" is inclusive of both signed and unsigned, so the largest value would be the largest value from the union of unsigned and signed possibilities, which is still 2^32 - 1.
@albertalman8919
2 жыл бұрын
@@breq8079 This argumentation doesn't hold, if it's just about the max number you could also map each integer to 10x it's actual value and now you can store 10x 2^32-1. What I'm trying to say is that 32 bit only says how many different numbers you can potentially store, the max value depends solely on your interpretation.
The three sums individual was incorrect. The sum(I, j, k) would just sum up the indices of the array not the actual values.
@ringobunny
2 жыл бұрын
the condition i!=j!=k also doesn't make sense lol. i!=j and j!=k and k!=i
Kenny : Name 10 programming languages Students : HTML HTML Programmers : OMG, I never got this much respect in my life.......Thank You.......😭 LoL😂😂😂
@iorekby
2 жыл бұрын
HTML is programming in the same way as setting up an easel and canvas is portraiture painting 🤣
Kenny Gunderman: solve these coding problems! also Kenny Gunderman: what is copy and paste shortcut? who knows that stuff?
harvard lady says "HTML" is a programming language. php: what am gonna do?
5:54 omg, that solution complexity is O(n^2) but we can do it faster by O(n) using hash_map (set data structure in Python)
Hell man those questions are too easy! As a russian highschooler I’ve seen problems sevral times harder! That student from MIT implemented a O(n^3) solution for a problem that can be solved much faster. Im pretty sure he knows faster solutions, but you accepted this one.
@alexchen4442
2 жыл бұрын
Really easy questions, most high schoolers who know a thing or two about programming can solve these with easy with no time complexity limitations
@piccolaradge8333
2 жыл бұрын
But that student wasn’t a CS major either and we also do not know how often he codes in his free time
7:00 it pains me that he forgot the closing bracket 3 times lmao His solution was also wrong, he summed the indices instead of the actual values :)
@Rocketos
2 жыл бұрын
I thought the same two things, he should have used list[i] , list[j], list[k]
@willardsun5437
2 жыл бұрын
the list is probably global though, so the values are probably accessed in sum() instead
@44r0n-9
2 жыл бұрын
@@willardsun5437 that's possible of course, but not very explicit and intuitive in this example. A sum function usually sums some values, not some values at the inidices that you pass :P
@markusknapp4466
2 жыл бұрын
been scolling dow the comments way to far for someone else to notice this :D
@vishnuteja0601
2 жыл бұрын
I think it could be done in dynamic programming right?
the max value for an integer isnt 2^32, its 2^31 -1 because an integer can also be negative
@ringobunny
2 жыл бұрын
if it's unsigned it could be 2^32-1, either way video was incorrect lol
The most creative and brilliant social experiment ever.
The facts that a HARVARD student called HTML a programming language is hilarious to me! It literally stands for The HyperText Markup Language... markup.
@TaiLe-ko3gq
2 жыл бұрын
Your comment like every one in Harvard must know coding
@clashoclan3371
2 жыл бұрын
Maybe they don't study coding?, Harvard is a uni not highschool.
1:47 Ohh that middle girl, that hurts soo much
@shivangbhardwaj3165
2 жыл бұрын
Lmao you got sharp eyes 👀 🤣
Last question binary_string = input() count = 0 for x in binary_string: if x == "0": count += 1 print(count)
@MrFranticboy
2 жыл бұрын
This will return the number of zeros in the whole list however the question is to return the number of the longest consecultive zeros.
@gantavyasaraswat2130
2 жыл бұрын
EHHHH wrongggg
See the maximum number that We can form using 32 bit integer will be (2^32) -1 ...but total number of combination that can be formed would be 2^32 only... See for example if we have 2 bit integer that total number of combination will be 2^2 but maximum number that We can form will be (2^2)-1.
5:15 when you realize how easy python makes things
The way those students give coding logic after reading the questions , damn, i wish i had that 😥
@vivminecl747
2 жыл бұрын
Same
He gave him 100 dollars on camera but he caught up to him around the corner and asked him to give it back (hidden camera!)
When i cheated through my first year of cs because it was at home learning and now I have no idea what im doing.
The first group of Harvard students was incorrect on the first question. There are 2^32 possible numbers in a 32 bit number, however the greatest number would be 2^31 - 1; and if the number was an unsigned integer, it would be 2^32 - 1. I’m a 15 year old doing the J277 GCSE Computer Science course btw
@chuckiem
2 жыл бұрын
I’m 14 dude how did u start
@roy4816
2 жыл бұрын
were*
@Sam-rz5hw
2 жыл бұрын
Yup
@darkflamemaster9334
2 жыл бұрын
im 2
@mq1469
2 жыл бұрын
@@jose.a.a.a lol
The max value of a 32 bit signed integer is 2^(31) - 1 and for unsigned int it is 2^(32) - 1, since you start with 0.
@heathkavanagh
2 жыл бұрын
But anyway I knew they got it wrong and a rushed straight to the comments after they said that 😂
@SameerKhan-nd5qb
2 жыл бұрын
@@heathkavanagh It's 2^31-1
@heathkavanagh
2 жыл бұрын
@@SameerKhan-nd5qb ah ok I know the formula is 2n - 1 where n is the most significant bit but I don't know it in this form
@heathkavanagh
2 жыл бұрын
@@SameerKhan-nd5qb im from the UK so I guess we do it differently, for instance for a 4 bit register the highest bit is 8 so we get 2(8) - 1 = 15
4:32 this should've been: 'what commands do you use to copy/paste in vim?'
Wish, my exams were this easy
*there's another java*
5:20 there are so many fun ways to do this. I'd just compare the last two. If not the same, then add. Only works for ordered list. But still fun. Early days of programming you often want to do the "correct" answer. But in reality there really isn't one. Other than the one that gets the result you are looking for and you understand the limitations of.
6:28 I don't find this solution sufficient. Let target = 13 x = [6,4,7,9,3,12] Even when correcting small mistakes, the two closest possible solutions would be: for i in range(len(x)): for j in range(len(x)): for k in range(len(x)): if i!=j!=k!=i: if sum([x[i],x[j],x[k]])==target: print(x[i],x[j],x[k]) and for i in x: for j in x: for k in x: if i!=j!=k!=i: if sum([i,j,k])==target: print(i,j,k) Both of these return all permutations of 6,4,3, but whether these permutations can be considered distinct solutions is another discussion. The problem is, that he either accidentally added range(len()) to all 3 loops or forgot to check for values rather than indices. Furthermore, he also forgot to put [] inside the sum function, a few parantheses and the condition that k!=i (you have to in Python), but these are more minor mistakes.
If it's in Indian schools class 12 (CS) I must have got all your bucks.
1:41 "There's another Java". Lol
Isn’t the correct answer for max 32 bit integer 2^32-1 ?
5:20 int[] duplicates = {1, 1, 2, 3, 3, 3, 4, 5, 5}; int[] uniques = Arrays.stream(duplicates).distinct().toArray(); For c++ use set 7:05 Let's say sum is 15 and array = [5, 5, 5]... His code will say there is no answer because 5 = 5 = 5
multiplying 12345 array in Lua local array = {1,2,3,4,5} local product = 1 for i, v in pairs() do product *= v end print(product)
Tell them to solve using optimal solution. Anyone can do these using multiple loops :p
@arnavsuri828
2 жыл бұрын
Facts lol
I'm going to hire this kid in my company!
The end part was amazing ❤ like you run away and came back to give 100 $ 😂
every student in middle school, high school, or college should be able to answer the copy and paste commands question.
0:50 - c'mon.. Answer should be 2^31 - 1, for an "integer".. Which is understood to be signed integer (not unsigned). Even for an unsigned integer 2^32 is not correct.. To get 2^32, you need 33 bits at least....
Time complexity of the solution given in video for three sum problem is O(n^3) which is pretty bad. We could first sort the array then two nested for loops and inside 2nd for loop we can run a binary search to find all three numbers and time complexity will reduce to O(n^2logn). Solution 2: If we have ample of space then we can make a new array of size equal to maximum value in given array and then put a headcount for the corresponding index in new array where index value is equal to the value in the given array. Then we can run two nested for loops to select any two values and for third value in we can just check directly through our new array if (13-val1-val2) has a headcount or not. This solution has time complexity of O(n^2) but space complexity is quite high. To be honest the problems were quite simple coz i m from petroleum engineering background and took coding for only one semester during my college in india and i could think the logic pretty quickly
@Alex-uh6qh
2 жыл бұрын
Man, this is the best comment))
@eTANG0
2 жыл бұрын
wow dude youre really smart man!! i think its totally super interesting just how big your brain is
@aashishmalik9408
2 жыл бұрын
@@eTANG0 this comment is not for some low iq guy, please refrain yourself from replying if u cant appreciate or constructively criticise the comment. Peace
@eTANG0
2 жыл бұрын
@@aashishmalik9408 no, it's cringe how you feel the need to mention your educational background to humblebrag. your comment would have been perfectly fine if you omitted the last paragraph. the fact that you called me low iq proves my point even further...
@aashishmalik9408
2 жыл бұрын
@@eTANG0 i put my background to convey two point that questions should have tough for mit students and the students should have given better answers for questions asked coz these were easy.
"Be careful you might get rinsed" i should have that printed on a tshirt
5:47 guys he said that is easy solution, but what about this: z = set([1,2,3,4,4,4,5,6,6,7]) x = set([1,2,4,4,4,4,3,3,3,6,7,8,9,0]) z.symmetric_difference(x) zz = list(z) print(zz)
Been learning to code on my own for almost a year, I got a test to qualify for an interview and I got the last question and failed halfway there lol The rest of the questions I could answer them.
can i technically say im smarter than a harvard student now then?
Max value of 32 bit int is 2^32 - 1
3 sum can be done in O(N2), by 2 loops u can get all (a+b) combinations , then make a single pass to find c in list as u already hv sum
This is a really cool content, keep it up 👍🏾, haven’t seen anyone use recursion but I guess I myself prefer iterative algorithms 😂😂
Haha, I've just started learning coding and now I can understand your questions there seems pretty easy question 😂
@daudbaig9019
2 жыл бұрын
Hahaha i wish interview or real life questions were like this, coz trust me haha its muuuuch harder then this
@Gideonsagar_art
2 жыл бұрын
@@daudbaig9019 🤣🤣yeah I got that too, it's really a huge world inside!
@debbieliz8612
2 жыл бұрын
How did u start because I’m so fucking lost and now I want to learn about coding and then come back to this video
@daudbaig9019
2 жыл бұрын
@@debbieliz8612 are u guys studying cs or somt? And if so what years are u guys in?
@daudbaig9019
2 жыл бұрын
@@debbieliz8612 and dont worry haha we are alll in the position, some pretending to understand more then others, but thats about it
8:03 java solution public class Main { public static void main(String[] args) { int[] num = {2,5,6,3}; int p = 1; for(int i = 0; i p = p * num[i]; } System.out.println(p); } }
Wrong soloution on the threesum question, should be for i in list: etc. for i in range(len(list)): returns the indices summed to 13..
I like it... You should give the at least one question for viewers and get answers at Discord or may be instagram.. If the answer is correct of someone you should pay them ... Thanks..
I'm ashamed to call myself a CS student, I suck with the history questions lmao, and for random NON-CS harvard students to know when python came out is beyond me like why do you even know that lolol. I'm going back to studying.
@joshushushu
2 жыл бұрын
Naruto
1:45 that girl lifted her arm for the high five and u aired her lmaoo
Max value of a 32-bit integer is 2^32-1 if unsigned, 2^31-1 if signed, NOT 2^32 which overflows to 0. Besides, the question "How many gigabytes are in a terabyte", technically the correct answer is 1TB = 1000 GB not 1024 GB although computer hardware marketing does the mistake all the time. If you expect 1024 you should ask "How many gibibytes are in a tebibyte?" 1 TiB = 1024 GiB.
Calling SQL and HTML programming languages? I was not expecting that considering they knew the Java release year
@olympic-ass-eater
2 жыл бұрын
And they attend Harvard 😲
@ignatheus
2 жыл бұрын
sql is a programing language tho.
7:25 are you guys sure that solution works, wouldn't it just loop through numbers 0 to 5 and not from the list. I think he forgot to write list[i]!=list[j}!=list[k[ and the same mistake in the other line as well?
@a.h.shanto
2 жыл бұрын
I was thinking the same. his loops works with general loop values, not the list values
@lawrenz6760
2 жыл бұрын
Syntaxically wrong but conceptually correct
1:45 bro the girl in the middle must've been regretting live decisions after she wasn't high-fived LMFAOOOOOOOOOOOOOOOOOOOO
The 2nd MiT solution is wrong. Solution: for i in range(len(list)): for j in range(len(list)): if i != j: k =target_sum - ( list[i] + list[j]) if k in list: return (list[i],list[j],k) return -1 #in case no combination is found.
1:45 First, HTML is a markup language, second, SQL is a database language, and third, JavaScript is a scripting language. The latter could be debated, but the first two are definitely not programming languages. The other answers are correct.
@careem3463
2 жыл бұрын
A programming language is any set of rules that converts strings, or graphical program elements in the case of visual programming language, to various kinds of machine code output. JS is a programming language
@yeppiidev
2 жыл бұрын
they all are programming languages: you write something in them and they tell the computer to do something. not all of them are Turing complete nor in the same category.
@olympic-ass-eater
2 жыл бұрын
@@yeppiidev html is not programming language
@yeppiidev
2 жыл бұрын
@@olympic-ass-eater it isn't. but it does include in the "base" category of programming language if you think of it as every language that can be used to make the computer do/output something. else, it's just a markup language as you meant
@manannaik1341
2 жыл бұрын
SQL is database management system not database language lmao
In the triple sum question, since the for loops are iterated over indices and not the values, the answer is actually wrong. The proposed solution is checking the sum of the indices, not the values corresponding the indices. It should have been sum(list[i], list[j], list[k]). Also, it would have been more optimized to do the following(brute force solutions suck anyways but this one is still better): for i in range(len(list) - 2): for j in range(i+1, len(list) - 1): for k in range(j + 1, len(list)): if(list[i] + list[j] + list[k] == target): return list[i], list[j], list[k]
@raghavsharma4837
2 жыл бұрын
Well urs soln's time complexity is way too high u should use map to reduce the TLE.
@emirarditi
2 жыл бұрын
@@raghavsharma4837 I've also mentioned that. I am not trying to propose a new solution, I was just trying to give an example of a correct way of solving this with 3 for loops(since the student solved it with 3 loops). Of course, there are various other methods to solve this with a better time complexity.
A lot of people are mad about them saying html css as programming lang But isn't html css turing complete, so you can say it's a programming language just used to front end ui designing and refactoring ui elements
Life is hard for nerds. Just look other youtube gaveaway video's,people smiling and getting 100$.On the other hand, nerds has to solve coding problems for 100 bucks!
7:27 doesn’t the MIT student’s solution sum the 3 indices instead of the list[index], ie the value? Nevermind the inefficient solution …
@simple69
2 жыл бұрын
yep lmao
@arielfayol7198
2 жыл бұрын
The 2nd MiT solution is wrong.
wouldn't the max value of 32 bit integer be half of 2^32 unless it's an unsigned integer?
@king-ij1ly
2 жыл бұрын
2^32 - 1 ig
@TheWorldOfLokalnub
2 жыл бұрын
Yeah it has to be 2^16 - 1.
how to remove duplicates: just place it in a datastructure that doesn't allow duplicates. like a map lmao way faster than doing those nested for's the thresome you only need 2 fors, not 3 add each number to a map and each each sum to a map where the key is the sum and the value is the result minus the sum. Now it's all o(1) to fetch the correct values if they exist would pretty weird if any IT student wouldn't be able to solve these. Harvard or not
Kenny's reaction when that MIT guy said Aero *Space* Engineering......LoL.....😄😄😄
Is using for instead of foreach a better idea? I always find it much easier to use foreach instead of using for loops and i.
love these videos!
how to find the longest sequence of 0's in Lua local binary = {0,0,0,1,0,0,1,0,0,0,1,1,1,0,0,0,0} local oldNumber local numberBeforePut local numberLooped = 0 for i, v in pairs(binary) do if v == 1 then return end numberBeforePut += 1 if numberBeforePut > numberLooped then numberLooped = numberBeforePut numberBeforePut = 0 end end print(numberLooped) -- this will print the number of the biggest series of 0's I think
Removing duplicates from list we can use set to do that and then we can convert set to list, but that guy solution was good 👍
Alternate title: Exposing Harvard CS students
didnt expect bruteforce from MIT people tho 😅
it’s cool how math is some peoples passion
4:38 dude, even my grandma knows that HAHAH
When you realise Python's older than Java '-'
i still cant understand why they are so happy for 100 $ ? they are paying this University 50k per year.
@amateruss
2 жыл бұрын
Free money is free money.
I’m over here watching this on my lunch break at my construction site….I need to go back to school
lis=[1,1,2,3,3,3,4,5,5] newlist=[] x=0 for counter in range(len(lis)): if lis[x] not in newlist: newlist.append(lis[x]) x+=1 print(newlist)
Very motivational video bro❤️
The coding challenges can be turned up a notch for 100$. Solving them with the brute force approach is pretty easy for any programmer. Try adding some constraints to the problems, for example the threeSum problem can be optimized to run in big O(N), which requires clever programming.
my solution to the array problem in JavaScript: const x = [[1,2,3],[4,5,6]] const y = [] x.forEach((arr) => {y.push(...arr)})