I really appreciate the explanation and how you visualize the problem! Great stuff!
@dnm9931
6 ай бұрын
Very clear concise explanation and visualisation! Thank you very much and please keep posting! You are highly appreciated!
@yilinliu2238
2 ай бұрын
the grid visualization really helped. finally understood this problem thank you
@jpkeys6000
8 ай бұрын
Once again, best visuals and explanation out there!
@jpkeys6000
8 ай бұрын
Once again, best explanation and visuals out there, thank you!
@guruprasaad4850
13 күн бұрын
class Solution: def productExceptSelf(self, nums: List[int]) -> List[int]: i = 0 length = len(nums) j = length - 1 left = list([1]);right = list([1]) for i in range(length-1): left.append( left[i] * nums[i] ) right.append( right[i] * nums[j] ) # backwards j -= 1 right.reverse() out = [ i * j for i, j in zip(left, right) ] return out
@rojerdu2759
Жыл бұрын
Awesome! Been waiting for this one!
@bullymaguire2335
Жыл бұрын
perfect . simplified .really easy to understand .kudos man . cant wait for more
@user-yz3yo1ql7p
11 ай бұрын
Very clear explanation, thanks!!!
@abhinav_mittal
10 ай бұрын
by far the easiest explaination
@ChamplooMusashi
10 ай бұрын
Though I could understand what the solutions were doing there was not much for the intuition behind it. This puts that crucial piece of the puzzle together. Thank you
@adammason482
Жыл бұрын
Thank you!
@voicubogdan4339
9 ай бұрын
Great explanation, i ha to watch it 2 times, but i understood it
@skinnycucumber
11 ай бұрын
thanks for this, and thanks for the captions.
@leetcodemonkey
7 ай бұрын
Great explanation!
@cocotv1519
Ай бұрын
Your explanation is really good but when u fill up the left and right, ur red line of box is not easy to understand. Instead of that, just say multiply every left side or multiply every right side elements. Not like one by one. For example, when we calculate every left side of 5, say 2*3*4. And I think until 4:12 mins are enough to understand this question. Thank you for your explanation.
@anwesagoswami5609
8 ай бұрын
thank you so much, good work...
@princessrad111
10 ай бұрын
This is amazing, thanks man
@lsdgaming7479
10 ай бұрын
thank you very much
@azka9075
11 ай бұрын
My only question is how do you even start coming up with an algorithm to solve it, i understand the solution but coming up with the solution in the first place is difficult for me, how do you think to start doing left and right products and multiply them?
@AlgoEngine
11 ай бұрын
I would give two suggestions for this. First, come up with an "dumb" brute force solution, then try to identify where improvements could be made. For this problem, I noticed that we were doing the same calculations over and over again, which was a hint that the optimal solution should only calculate each product once. Second, if you're really stuck and can't figure out the answer, it's ok to look at the solution, but take some time to really understand why the solution works. If you can understand how and why it works, it'll become easier for you to spot similar patterns in other problems.
@azka9075
11 ай бұрын
@@AlgoEngine I see, thank you! i guess it comes down to practice, kind of sad i dont have a natural talent for spotting solutions :(
@AlgoEngine
11 ай бұрын
@@azka9075 It definitely comes down to practice! I promise it gets easier the more you practice 🙂
@DevanshClasses
8 ай бұрын
My Solution nums = [3, 2, 4,0] res=[] nums1=copy.copy(nums) print(nums1) for i in range(0, len(nums1)): nums1.remove(nums[i]) prod=reduce((lambda x,y:x*y),nums1) res.append(prod) nums1.insert(i,nums[i]) return(res)
@runesbroken
Жыл бұрын
Could you also find the product of all elements, and divide by each num[i] to create the product array
@AlgoEngine
Жыл бұрын
Unfortunately, the question prohibits us from using division (0:21) but if division was allowed, then yes, that would probably be the best way!
@DevanshClasses
8 ай бұрын
@@AlgoEngine nums = [3, 2, 4,0] res=[] nums1=copy.copy(nums) print(nums1) for i in range(0, len(nums1)): nums1.remove(nums[i]) prod=reduce((lambda x,y:x*y),nums1) res.append(prod) nums1.insert(i,nums[i]) return(res)
@tomdriver6733
11 ай бұрын
Could you use C++, Java or C#, please? Python is hard to read.
@MaruBaku
Жыл бұрын
discord server?
@AlgoEngine
Жыл бұрын
No discord server right now, but I may make one in the future!
Пікірлер: 31