Next level teaching sir !! You are literally a hidden gem!!
@nikoo28
10 ай бұрын
glad you feel that way
@ass2412
Жыл бұрын
I was stuck in neetcode and i thought it would be impossible. After seeing your video, i understood clearly
@nikoo28
Жыл бұрын
thanks for your feedback and support :)
@mustafahassan9383
Жыл бұрын
OMG , same happened to me 🤣🤣🤣🤣
@anjuverma285
11 ай бұрын
@@mustafahassan9383😊
@devdattrupapara1890
8 ай бұрын
same happened to me returns..
@shreehari2589
7 ай бұрын
Same
@abhigoku2022
7 ай бұрын
Hi Sir, Eveytime I am searching for a leeetcode problem, I add your name in the suffix hoping you have done a video on it. I have understood each and every video that I have watched. Please do solve all the problems, that will be very helpful for people like me.
@sianwa11
10 ай бұрын
Recently found your channel, whenever I don't understand neetcode solutions I come here. Thank you sir!
@nikoo28
10 ай бұрын
@neetcode is also an amazing channel :)
@simiiv5021
6 ай бұрын
Same!
@sivaramansankar7463
Жыл бұрын
thanks for the lucid explanation , you're a hidden gem :) , you deserve way more subscribers
@nataliechan8535
9 ай бұрын
Your explanation is so clear! I like how you draw out everything to explain it! Thank you
@nikoo28
8 ай бұрын
The drawing really helps a lot 😄
@user-qn9um8ud1t
2 ай бұрын
Thank you so much for explaining each line in a very simple manner.
@gameplays8457
Ай бұрын
Really good explanation. Clearly understood the concept. Thank you!
@kaushit
5 ай бұрын
I usually don't comment but this kind of video I see my hands automatically goes in comment section for comment. Thanks Nikhil you even demystified how dividing will give results, most of people don't know how dividing is giving the answer and thanks for explain postfix and prefix in detail.
@_arnav_chaudhuri
22 күн бұрын
Next Level Teaching Subscribed !!
@raool7
19 күн бұрын
love the way you teach
@vikrantt22
Ай бұрын
I used the same approach but instead of having left and right array I create a function that calculates prefix product and another function to calculate suffix product and at the end multiply prefix product and suffix product to obtain final answer but this answer exceeds the time limit. Thank you for simple explanation of same logic from another POV.
@nikoo28
Ай бұрын
that approach works too
@vikrantt22
Ай бұрын
@@nikoo28 Yeahh but for that approach time limit exceeds.
@gayatriyadav4007
Ай бұрын
Very well explained!
@sohanchoudhary1744
27 күн бұрын
God level explanation sir
@covert000
Ай бұрын
Exellent Explaination sir
@abhishekkeshri3974
Жыл бұрын
like always your explanation and video quality is awesome. i will try to share your videos as much as possible .
@nikoo28
Жыл бұрын
So nice of you
@abhishekanand8574
6 ай бұрын
THANK YOU , I TRIED VERY HARD BUT COULD NOT SOLVED. YOU CLEARED IT IN A MIN .❤❤❤❤❤❤
@meetshah545
5 ай бұрын
Very nice explanation, I really search your channel for Ds-algo questions . Thanks sir for teaching free.
@Infinitycoder01
Жыл бұрын
I like your way of explaining the problem , with this i learnt to solve problems and as well as the way of explaining the code to others. It helped me a lot in my interview.Thank you so much.
@nikoo28
Жыл бұрын
I try to approach the problem in a way as you would do in an interview. Glad it helps :)
@ashishgoyal6256
Жыл бұрын
Follow up: Can you solve the problem in O(1) extra space complexity? (The output array does not count as extra space for space complexity analysis.)
@harshsharma2888
12 күн бұрын
Next Level sir
@SMK1455
Ай бұрын
Thank you a lot for such great explanation of the problems!
@divyasingh6757
2 жыл бұрын
Here our space complexity can be reduced to O(1)..overall nice explanation
@thakur6030
17 сағат бұрын
how can be s.c reduced to 0(1);
@saisree04
3 ай бұрын
Excellent explanation. I am so glad that I came across your YT channel
@infinite639
2 жыл бұрын
i have shared your tutorials to my friends
@nikoo28
2 жыл бұрын
Thank you so so much 😄
@papayaw2920
11 ай бұрын
Keep going Nikhil, I was stuck and I was about to give up too. I feel taught today
@nikoo28
10 ай бұрын
glad that was helpful
@user-ph5ek8tg5l
3 ай бұрын
Leetcode has mentioned to try O(1) space solution. You should add one more part in the video for such optimizations.
@sameerdas2468
4 ай бұрын
Man you are god 😭🙏 your explanation is outstanding 👏 you earned a subscriber today ❤️.
@thenormalpen1900
2 ай бұрын
Wow, that is such a clear soln, thanks!
@zahraBatenin
Жыл бұрын
you explained it very well. thanks
@nikoo28
10 ай бұрын
So nice of you
@Aryan-oc1fq
10 ай бұрын
recently found your videos, and im loving the explanations. thank you !
@nikoo28
10 ай бұрын
hope they are of help to you
@kenilkanani16
Ай бұрын
Awesome explanation 🎉
@LongNguyen-pe5uo
Жыл бұрын
Good video, very easy to understand.
@infinite639
2 жыл бұрын
Thanks bhai leetcode ke videos banate raho mere liye or sabke liye Love you bro
@nikoo28
2 жыл бұрын
Thanks for the love
@truecoding8659
2 жыл бұрын
Here is my solution in python, i used to for loop and it givs the same answer. arr=[2,1,3,4] arr1=[] r=1 for i in range(len(arr)): pro=arr[i] for j in arr: if j is not pro: r=r*j arr1.append(r) r=1 print(arr1)
@nikoo28
2 жыл бұрын
but the time complexity of your solution is O(n^2)...because of the nested loops. You can try to improve that.
@avanishraj386
Жыл бұрын
@@nikoo28 this will fail when arr = [0,0]
@nikoo28
Жыл бұрын
@@avanishraj386 did you try the code given on github? It will work with your sample test case. What error are you getting?
@avanishraj386
Жыл бұрын
@@nikoo28 I am not talking about your code, I have replied the above comment of "True Coding".
@c4rtel
Жыл бұрын
Very nice explanation.
@MdArif-pc9bz
2 ай бұрын
Thank you
@user-rg1dr1ou6f
9 ай бұрын
Fall in love with your explanation ❤❤❤❤❤❤❤❤
@benvan3721
Ай бұрын
What each line of code does matters and very impotant to understand too. I wish you explain that rather than reading it.
@nikoo28
Ай бұрын
Thanks for your feedback. But my friend, my channel primarily focuses on problem solving rather than writing the code. Because the code languages will keep on keep on changing with time. Problem solving skills will always remain the same. I would always encourage you to write the code on your own to become a better developer. If you are looking to learn the code line by line, there are a lot of videos who do a better job than me. :) Plus you have so many AI technologies to explain the code.
@vivekjaiswal4391
Жыл бұрын
Great teacher 👏
@anishasaini380
6 ай бұрын
Sir Best Explanation!!
@yxs7
Жыл бұрын
u are the best! thx! ❤👏✨
@nikoo28
Жыл бұрын
you are the best
@kamehameha38
Жыл бұрын
Nicely explained. Thank you very much
@kirthananambiar8873
Жыл бұрын
Thank you so much sir. Explained very well.
@Max-tq1ig
Жыл бұрын
Totally understood. Thanks a lot.
@piyushanand3135
6 ай бұрын
Amazing Explaination
@benmyths
Ай бұрын
thanks
@Piyush-me9nu
8 ай бұрын
Amazing explanation!
@rishabhsaini7836
Жыл бұрын
Nicest explanation ❤❤
@mikedelta658
8 ай бұрын
Excellent explanation.
@nikoo28
8 ай бұрын
Glad you liked it
@SingwithSuhas
8 ай бұрын
superb
@AravindKumar-lj7kx
Жыл бұрын
Thanks a lot....you are great....
@clasherrony6526
4 ай бұрын
amazinggggggg
@subee128
8 ай бұрын
Thanks
@Dineshkumar_dk
11 ай бұрын
but we have to solve this with O(1) space
@nikoo28
10 ай бұрын
let me come back to you.
@ankit_yr_senpai
3 ай бұрын
great
@jayeshjain4540
7 ай бұрын
Sir the question also says You must write an algorithm that runs in O(n) time and without using the division operation.
@nikoo28
6 ай бұрын
I don't use the division operator.
@Eatbite7
2 жыл бұрын
The way you teach it feels like there is nothing in DSA
@nikoo28
2 жыл бұрын
Thanks for the appreciation…I really try to simplify things as much as possible.
@thakurabhishtpratapsingh1686
5 ай бұрын
i was getting time limit exceeded for one of the test cases.
@nikoo28
4 ай бұрын
Check out the code given in video description
@nenuanenenuane6645
Жыл бұрын
Thank you bro❤❤
@yuvamamidipalli7127
4 ай бұрын
Sir i didn't understand the approach that you have explained about 2^32 and 10^12>2^32
@nikoo28
4 ай бұрын
What part are you getting confused with?
@bun_bun17
Жыл бұрын
you are great :)
@robertnant1264
5 ай бұрын
Thank you for the video. But somehow I don't know how it's possible to find the solution without knowing this trick (prefix, suffix). What am I missing in my reasoning?
@nikoo28
4 ай бұрын
This is a kind pf problem which comes with practice. The idea is that once you solve a problem like this, it will open your mind and you will try to apply the same pattern to future problems.
@user-om9lc1qt9t
Жыл бұрын
class Solution: def productExceptSelf(self, nums: List[int]) -> List[int]: # Check if the input list is empty if not nums: return [] length_of_nums = len(nums) # Initialize the result list with 1s result = [1] * length_of_nums product = 1 # Calculate the product of all elements to the left of each element for index in range(length_of_nums): result[index] = product # Store the product of elements to the left product *= nums[index] # Update the product for the next element product = 1 # Calculate the product of all elements to the right of each element for index in range(length_of_nums - 1, -1, -1): result[index] *= product # Multiply by the product of elements to the right product *= nums[index] # Update the product for the next element return result
@58harshverma57
Жыл бұрын
brackets are not allowed here; to declare an array, place the brackets after the name int[] left = new int[nums.size()]; ~~ ^ [] this error is coming
@nikoo28
Жыл бұрын
Please recheck your code. The declaration is correct. Also check my complete code in the github link available in video description.
@58harshverma57
Жыл бұрын
@@nikoo28 yes sir I have corrected it ..I haven't made left and right as vectors! Thanks for the solution ! 😄
@sainathkadam2213
Жыл бұрын
You r osm 🔥
@nikoo28
Жыл бұрын
Thank you so much 😀
@vlogsaryan2540
2 жыл бұрын
Bhaiya why would you used num[i-1] and [n+1] in both the left and right Loop pls explain
@nikoo28
2 жыл бұрын
please try to look at the explanation of the left and right array once again, we have to skip those elements. if you are still confused..let me know
@danishmehmood6110
Ай бұрын
bro this problem has a better and more simple solution step 1 - just calculate the product of the whole array in this example the answer would be 1*2*3*4=24 step 2 - in the second step to calculate result [ i ] just divide the calculated result by nums [ i ] e.g to calculate result [ 0 ] = 24/1 =24 result [ 1 ] =24/2 =12 and so on
@nikoo28
Ай бұрын
does this method get accepted? I believe you will hit limits when trying to multiply all the numbers.
@siddharthmehta4223
Жыл бұрын
it gives the following error for the array you created to store right side value. error: cannot find symbol [in __Driver__.java] int[] ret = new Solution().productExceptSelf(param_1); ^ symbol: class Solution location: class __DriverSolution__
@nikoo28
Жыл бұрын
Check the github link in the description below, for a working code :)
@prakhargarg4166
8 ай бұрын
Question says no extra space, then why left and right arrays
@nikoo28
8 ай бұрын
That part got added to the question recently. It wasn't there when I created the video. Will post an update soon on it.
@user-kd5gp4ds4p
11 ай бұрын
i think this is good approach then your code please review it solving in O(n) time and o(1) space complexity class Solution { public: vector productExceptSelf(vector& nums) { int zero = 0; int tmul = 1; for(auto num : nums){ if(num) tmul *= num; else{ if(zero){ tmul = 0; break; } zero++; } } for(auto &num : nums){ if(num) num = zero>0 ? 0 : tmul/num; else num = tmul; } return nums; } };
Пікірлер: 115