I really appreciate the explanation and how you visualize the problem! Great stuff!
@dnm99319 ай бұрын
Very clear concise explanation and visualisation! Thank you very much and please keep posting! You are highly appreciated!
@Sanai9Ай бұрын
the explanation of the logic is just fantastic!!
@yilinliu22385 ай бұрын
the grid visualization really helped. finally understood this problem thank you
@jpkeys600011 ай бұрын
Once again, best visuals and explanation out there!
@jpkeys600011 ай бұрын
Once again, best explanation and visuals out there, thank you!
@廖敏翔-m8r Жыл бұрын
Very clear explanation, thanks!!!
@abhinav_mittal Жыл бұрын
by far the easiest explaination
@ChamplooMusashi Жыл бұрын
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
@bullymaguire2335 Жыл бұрын
perfect . simplified .really easy to understand .kudos man . cant wait for more
@rojerdu2759 Жыл бұрын
Awesome! Been waiting for this one!
@skinnycucumber Жыл бұрын
thanks for this, and thanks for the captions.
@leetcodemonkey10 ай бұрын
Great explanation!
@voicubogdan4339 Жыл бұрын
Great explanation, i ha to watch it 2 times, but i understood it
@anwesagoswami560911 ай бұрын
thank you so much, good work...
@adammason482 Жыл бұрын
Thank you!
@ruslan2676Ай бұрын
how on earth you came up with this solution omg :D
@princessrad111 Жыл бұрын
This is amazing, thanks man
@lsdgaming7479 Жыл бұрын
thank you very much
@guruprasaad48503 ай бұрын
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
@azka9075 Жыл бұрын
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 Жыл бұрын
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 Жыл бұрын
@@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 Жыл бұрын
@@azka9075 It definitely comes down to practice! I promise it gets easier the more you practice 🙂
@cocotv15194 ай бұрын
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.
@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!
@DevanshClasses11 ай бұрын
@@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)
@nilayyener8585 күн бұрын
@@DevanshClasses The time complexity of this code is not O(n)
@tomdriver6733 Жыл бұрын
Could you use C++, Java or C#, please? Python is hard to read.
@DevanshClasses11 ай бұрын
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)
@nilayyener8585 күн бұрын
The time complexity of this code is not O(n)
@MaruBaku Жыл бұрын
discord server?
@AlgoEngine Жыл бұрын
No discord server right now, but I may make one in the future!