Тёмный

Exploring LeetCode's WORST Questions 

Colin Galen
Подписаться 235 тыс.
Просмотров 27 тыс.
50% 1

A top competitive programmer from the Codeforces/CodeChef realm (with almost zero prior interview experience) takes on the most annoying questions known to LeetCode to find out... how good is competitive programming, really? Is it enough to take on even the most annoying questions that LeetCode has to offer? Or will I struggle, like a lot of others probably did? Find out in this video experiment.
Resources
Online script: github.com/fatliau/leetcode_M...
My script: pastebin.com/Fdhfxq65
Raw CSV: pastebin.com/eCrBuDgJ
Questions
Q1 (91.7% disliked): leetcode.com/problems/largest...
Q2 (90.8% disliked): leetcode.com/problems/basic-c...
Q3 (90.3% disliked): leetcode.com/problems/longest...
Music
Local Forecast - Slower by Kevin MacLeod
Link: incompetech.filmmusic.io/song...
License: [yt dislikes this link, removed]
Sthlm Sunset by Ehrling
• Ehrling - Sthlm Sunset
(not exactly sure how to credit, the given link is dead)
This Is For You (Prod. by Lukrembo)
Link: • lukrembo - this is for...
Timestamps
0:00:00 Intro
0:00:46 Format
0:01:29 Q1 (91.7% disliked)
0:26:03 Q1 - Recap
0:26:38 Q2 (90.8% disliked)
1:08:52 Q2 - Recap
1:09:43 Q3 (90.3% disliked)
1:11:55 Q3 - Recap
1:12:20 Conclusion

Наука

Опубликовано:

 

28 май 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 61   
@alperkaya8919
@alperkaya8919 Год назад
I spent 7 hours without giving a break on "Recover a Tree From Preorder Traversal". But I've solved it at the end. My code was over 100 lines, and I even had to force a hashmap to handle duplicate keys. But it was worth it at the end, and it was my first hard question I've solved. So, one hour on a hard question is nothing in my opinion.
@danielgysi5729
@danielgysi5729 Год назад
Controversial, but I honestly think a lookup table is a totally valid solution to the first problem and I think having an interview question like that is really valuable. Sometimes there just isn't a clever math trick that makes your program 100x faster. In the real world you need to compromise sometimes and saying "We never expect to receive input greater than n so precomputing f(x) for all x
@30svich
@30svich Год назад
but there is actually a math trick, and he explains in the video someone solved this problem mathematically as it should be. it is not a bad problem, just people did not want to get involved with math.
@programmer9660
@programmer9660 Год назад
Colin I love that you’re thinking out loud, keep doing that. Cheers
@wesleyso0
@wesleyso0 Год назад
Amazing! Thanks for putting in all the hard work into making these videos! I hope I can be as good of an explainer as you are!
@bufdud4
@bufdud4 Год назад
I wonder if your employer would be more impressed to see you solve a difficult problem in less than said minutes versus communicating which would usually take 3x or 5x longer.
@anon3501
@anon3501 Год назад
Communication is more important. This guy is wasting his time at this point, industry experience is more valuable then solving LC quickly lol
@FinnBender
@FinnBender Год назад
@@anon3501 I mean he (probably) does this for his and our entertainment... Calling it "wasting time" seems a little harsh.
@anon3501
@anon3501 Год назад
@@FinnBender true, i was just suggesting to build or work on something with his skills versus solving problems that add no value to the world
@vishnuvs6121
@vishnuvs6121 Год назад
What you are saying is correct, but he's not doing this for appearing in interviews. People do this stuff for the fun of it too, as a hobby.
@anon3501
@anon3501 Год назад
@@vishnuvs6121 You shouldn't be taking pride just in things like leet code, its a fun puzzle game but it shouldn't be a major motivator for you. Programmers are solving problems for people or doing something of value for people over what they could be doing
@Matthew4770
@Matthew4770 Год назад
You updated your browser! So proud of you!
@user-he4st2ro5h
@user-he4st2ro5h Год назад
Hey Colin, I had a failed attempt to pass an online assessment for Amazon SDE position, and one of the tasks was leetcode # 2281, which is in top 15 with the least acceptance rate. Could you solve and explain it, please?
@rupok9999
@rupok9999 Год назад
how about Codeforces Round #815 (Div. 2) today ?
@fiveCSGO
@fiveCSGO Год назад
how many years have you been programming in total?
@NobleSavvy
@NobleSavvy Год назад
Dude Q2 had to feel so good to complete
@kennethkath6527
@kennethkath6527 Год назад
Hey Colin, how are you so good at this? Takes me forever to solve even one question
@Supakills101
@Supakills101 Год назад
practice
@adriancornel864
@adriancornel864 Год назад
Brains.
@Profit.Genius
@Profit.Genius Год назад
A lot of practice
@tedchirvasiu
@tedchirvasiu Год назад
Probably half asian
@saurabh5148
@saurabh5148 Год назад
Must be pretty good mouse.
@saharshluthra6492
@saharshluthra6492 Год назад
Hi Colin, For the first problem, the result has to be a palindrome, and apart from n = 1, safe to assume that answer will contain even number of digits. Which means it will be always be divisible by 11. So you can put a condition for one of your numbers to be divisible by 11, only then look for second number possibilities, this will pass leetcodes' time limit. Edit: Just resumed the video and realized this is already covered :)
@MichaelSt
@MichaelSt Год назад
Why would the answer have an even number of digits?
@saharshluthra6492
@saharshluthra6492 Год назад
@@MichaelSt You're multiplying 2 n digit numbers, presumably starting off with 8 or 9 as their first digit. so something like (8 * 10^(n - 1) + something smaller) * (8 * 10^(n - 1) + something smaller). So 64 * 100^(n - 1) + something small. This is clearly even number of digits.
@MichaelSt
@MichaelSt Год назад
@@saharshluthra6492 a lot of assumptions there, like the number starting with 8 or 9, and the something small not "overflowing" into the next digit. I mean you can convince yourself it doesn't happen for 1
@saharshluthra6492
@saharshluthra6492 Год назад
@@MichaelSt The something small is < 10^(n - 1) and it physically cannot contribute to another digit. 9999 * 9999 has the same number of digits as 4000*4000. The only way to get another digit is 10^4 * 10^4 which is are both n + 1 digit numbers now. Even if you consider a completely random distribution of what you're going to get as a result of multiplication, which it's not, the probability of you not finding a palindrome is astronomically small, and it gets even smaller as n grows. The assumptions don't get weaker, they get even stronger for n > 8. Same goes for starting digits, as n grows, assuming completely random distribution, the chances that you find numbers starting with 999.... become even greater.
@rohitpunetha9506
@rohitpunetha9506 Год назад
Your Background music is very haunting😈 Nice content though.
@oxi2118
@oxi2118 Год назад
I learn so much from just watching you code
@akashkumarsahoosibun8191
@akashkumarsahoosibun8191 Год назад
I do not know why by seeing your thumbnail I feel so good
@tedchirvasiu
@tedchirvasiu Год назад
The thumbnail is back
@_sixtyfour
@_sixtyfour Год назад
For 50k subs, you should speed run eating 50 donuts
@michaelmoran9020
@michaelmoran9020 Год назад
For the 3rd one I do not understand why that trivial solution is the answer. When I read it I thought that for two strings "abcefg" "abcxyz" that the answer would be 3, with the subsequences being efg and xyz?
@muddycalendar3292
@muddycalendar3292 Год назад
The string itself is a subsequence, so if you have abc and abd, the longest subsequences will be abc and abd, and since the subsequences are different, they can’t be in both
@michaelmoran9020
@michaelmoran9020 Год назад
@@muddycalendar3292 I'm trying to figure out what implicit condition i was applying to reach my version
@HHJoshHH
@HHJoshHH Год назад
Cool video man. Only 4 weeks into programming but…this is fun to watch and try to understand. I’m starting in Python but I feel like I should be coding in JS. I’ll be lucky if I ever get smart enough to get a UI/UX job let alone an actual web/app dev job. 😅
@keerthivasan9548
@keerthivasan9548 Год назад
Bro can you able to make a tutorial on union find operations on matrix
@BODYBUILDERS_AGAINST_FEMINISM
Cool videos man
@freyappari
@freyappari 8 месяцев назад
I solved the first one fine,,, class Solution: def largestPalindrome(self, n: int) -> int: if n == 1: return 9 max_num = 10 ** n - 1 min_num = 10 ** (n - 1) for num in range(max_num, min_num - 1, -1): # Construct a palindrome by joining num with its reverse palindrome = int(str(num) + str(num)[::-1]) # Check if this palindrome can be represented as the product of two n-digit integers for i in range(max_num, int(palindrome ** 0.5) - 1, -1): if palindrome % i == 0 and palindrome // i
@cwagnello
@cwagnello Год назад
91 multiplied by a number with "n" digits of 9 is a palindrome but that doesn't help with the question
@MD-lw4kw
@MD-lw4kw Год назад
Krita and bloons TD 6🔥
@Jasturtlegang
@Jasturtlegang Год назад
The real solution to the first largest palindromic product is n = 2 + (987-2); Return n; Ez i don't get why so many dislikes
@xyphenius9942
@xyphenius9942 Год назад
Why do you mostly use C++ ?
@MichaelSt
@MichaelSt Год назад
Its efficiency is good for competitive programming
@gabrielabdul
@gabrielabdul Год назад
We need more creativity with these thumbnails -- nice vid tho.
@kaitmob3847
@kaitmob3847 Год назад
Its ironic how he is a competitive programmer but used someone else's code to find the questions
@keerthivasan9548
@keerthivasan9548 Год назад
Leetcode 862
@decafbad5529
@decafbad5529 Год назад
cute boymoder
@mdyousufgazi4030
@mdyousufgazi4030 Год назад
💥💥💥💥💥💥
@ciupanezubogdanel
@ciupanezubogdanel Год назад
3 + years of competitive coding experience, and when this guy is looking for the highest palindrome number from a product...he iterates up from 1 to 1000...instead of down from 1000
@Splish_Splash
@Splish_Splash Год назад
(high - i) * (high - j) means nothing to you?
@Daman1628
@Daman1628 Год назад
@@Splish_Splash lol
@thetallesthobbithsaka3050
@thetallesthobbithsaka3050 Год назад
You guys are spending 1 hour on hard questions, i though medium takes that much 👀
@bhanupratapsharma6158
@bhanupratapsharma6158 Год назад
Your voice is not coming
Далее
Taking On Google's HARDEST Interview Questions
1:25:26
Просмотров 15 тыс.
When Your Team Loses on Penalties 😢
00:20
Просмотров 375 тыс.
ДЕНЬ РОЖДЕНИЯ БАБУШКИ #shorts
00:19
🇮🇩Let’s go! Bali in Indonesia! 5GX Bali
00:44
If my code fails, the video ends (LeetCode)
25:51
Просмотров 11 тыс.
I Tried To Speedrun LeetCode
1:06:17
Просмотров 54 тыс.
Ranking Every Data Structure & Algorithm
39:13
Просмотров 63 тыс.
100K-ish eating donuts + chill Q&A
4:15:34
Просмотров 12 тыс.
Dissecting FAANG Interview Questions
44:37
Просмотров 18 тыс.
Code With Me: 24 FAANG Interview Questions
3:39:55
Просмотров 106 тыс.
I Tried To Speedrun LeetCode MEDIUMS
1:00:55
Просмотров 35 тыс.
Top Competitive Programmer vs. Google Coding Interview
43:28
📱 SAMSUNG, ЧТО С ЛИЦОМ? 🤡
0:46
Просмотров 1,7 млн
Samsung S24 Ultra professional shooting kit #shorts
0:12