How to EASILY solve LeetCode problems

preview_player
Показать описание


#coding #leetcode #python
Рекомендации по теме
Комментарии
Автор

This umm.. went over my head tbh. Although good for a quick revision for those who have already solved this or aware about the concept or the trick

utkarshdewan
Автор

the second rule of leetcode is to figure out where to use a hashmap ;)

fogcat
Автор

Bro i didnt even understand the problem 😂

AlwafiCharki
Автор

It sucks because this is what whiteboarding interviews were for, literally visually solve the problem first with the interviewer -> code it out. Now with all virtual interviews, it’s much harder to communicate if you can’t verbalize exactly how you’re problem solving/thinking

lvmrjb
Автор

Thanks! Do you really need a stack? What about O(1) space just by scanning right to left. Compute arrival time of element R then scan leftwards with L pointer to skip all elements with earlier arrival times. Then increment your count. Snap the R pointer to L pointer. And repeat.

venkatinator
Автор

Bro, you are one of the rare programming lecturers on Youtube that visualize the problems 😭

DaThuFlorida
Автор

i remember learning this problem it was such a brilliant solution

lingyundai
Автор

How am i supposed to come up with that graph though

WazobiaTechGuy
Автор

One liner for all of y'all trying to fail your job interview 🙌

reduce(lambda fla, pair: (fla[0] + int((target - pair[0]) / pair[1] > fla[1]), max(fla[1], (target - pair[0]) / pair[1])), sorted(zip(position, speed), reverse=True), (0, -1))[0]

maxguichard
Автор

So naive recomendation, the most difficult part of LC problems solving is to understand what is needed.

sergeynazarov
Автор

Yeah I do that too, but my problem is just turning my answer to code is hard..

lol I guess that only be fixed with time

TheRealFakrRLive
Автор

LoL my brain was screaming union find union find!! Lol

killerthoughts
Автор

Computer science interviews have gone rogue!

unebonnevie
Автор

Fucking python man, I swear it already solves all the DS parts of any leetcode problem

MehdiGlz
Автор

Lowkey buying a drawing tablet levelled up my leetcode game 🎉

Supakills
Автор

Why do you need to do the [list comprehension] instead of just calling sorted on the zip output?

KingXKok
Автор

Thats so easy to visualize. I could have told you 3 and Im a mechanical engineer.

Max-jube
Автор

thanks for that great video, I have one question which is should I solve leetcode problems after finishing each topic (I mean solving problems on each specific topic) or should I wait until I finish the full DSA roadmap of whatever course I'm taking then start solving problems on the full DSA?

ahmedelhadary
Автор

At least leetcode gives you drawings, during the interview they wont give you any diagram or drawing so understanding the problem is harder.

RolopIsHere
Автор

The array speed is enough to solve this problem just by comparing the speeds of those cars.

supercellburner