LeetCode 238. Product of Array Except Self (Solution Explained)

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


Preparing For Your Coding Interviews? Use These Resources
————————————————————

Other Social Media
----------------------------------------------

Show Support
------------------------------------------------------------------------------

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

Whenever I need to find a solution to any Leetcode problem I look into your channel first. None other explains like you do! Claps claps 👏👏

RakaChowdhuryUK
Автор

How the hell are you supposed to figure this out without knowing the “ah-ha” trick?

jelliott
Автор

Thanks a lot! The transition from 2 arrays to 1 becomes really intuitive.

grootz
Автор

Hey thanks for mentioning the difficulty in the thumbnail itself- keep up the great work!

edwardnewgate
Автор

This was a really excellent explanation. I went through it a couple times but the code was just intuitive after the explanation! Your videos really help a lot man. Thanks!

louismontes
Автор

I get it, but I don't get how you're supposed to figure this out in a 30 min interview and I've done a few of these. I don't think the person who came up with this problem did it in 30 mins, do they just expect people to have done all these problems before?

kickhuggy
Автор

Great video! Love that you solved it first with the extra space and then simplified, much easier to follow.

BrentSnider
Автор

I just solved this today, but wow you really made it click for me when you said pretty much everything to the left of x times everything to the right of x. NOW it makes sense. Thank you Nick.

shadowthehedgehog
Автор

Really loved this explanation. Thanks. Man what a bummer, leetcode's Solution is locked unless you're Premium atm. Good thing this video is out there

Sandboxcode
Автор

ive watched several videos of this problem and yours has the best explanation by far. Thanks!

fcsie
Автор

Thanks nick. as a beginner this question really fried me. it is nice to have a clean explanation.

leezhenjian
Автор

I got this problem as a take home interview. One detail you didn't mention is checking for zeros. Once you hit a zero, that's the only element that needs to be calculated. Once you hit two zeros the problem is over and you return all zeros.

NickKravitz
Автор

Thank you for the first solution! Made SO much more sense than the leetcode answers..

nullnull
Автор

is there a textbook you might recommend for someone wanting to improve their understanding of Data Structures and Algorithms?

mr.plua
Автор

I am seriously addicted to his videos!

suharajsalim
Автор

Thanks Nick! Boy I did hate this question

lily_h-mj
Автор

Great video.

I have a query - if we haven't seen such category of problem what is the likelihood of coming up with the most optimal solution in 30-35 mins.

I have solved around 70-80 problems in leetcode, and occasionally there are such questions which stump me. Now I have seen this, so a variety of this should be easy!

Does this mean we have to solve a huge numbers of problem, and hope that the problems asked at FAANG interview is a variety of what I have seen before ?

thedanglingpointer
Автор

2:20 also if the array contains 0 then it will give error, as you cannot divide a number by 0.
Am i right????

rishabhrajpathak
Автор

This was the interview question i had for the amazon internship

rebechkah
Автор

Thank you! I was always confused about this problem but now I get it

omgharajuku