If anyone is new to this bootcamp! Let me tell you it's amazing I've completed almost every single videos so far. By the end of the playlist you'll have so much confidence to tackle DSA questions by your own. Just make sure you're following the notes + assignments & Tips that kunal gives !! Some tips that I always remember when i approach a problem (kunal has mentioned it) - Don't memorize, understand the problem / logic - Hard Question is easy for those who have studied, Easy Question is hard for those who haven't - The function will return from where it was called !! ( Recursion )
Why is this bootcamp is unique? It teaches you the thought process of how kunal solves these questions and how you can also get the intuition and approach these problems. Its not just a course where the teacher is just solving and solving questions, rather it helps you build the thought process.
Wow, Kunal! Your DSA playlist is absolutely phenomenal. The way you've explained each topic with such clarity and depth is truly commendable. This playlist is hands down one of the best resources for learning DSA on UA-cam. I've been following it for the past two months, and it has been incredibly helpful! However, I noticed that dynamic programming and graphs are yet to be covered. Could you please consider adding these topics? Completing them would make this course the ultimate DSA resource on UA-cam. Thank you so much for your hard work and dedication🙌🤝!
These videos are so great, i am also done with each and every video, and just looking forward for notification of new Videos, .... It would be very grateful of Mr. Kunal if he could be more frequent in uploading videos, ❤❤ i don't have much patience for your videos
String has a function called contains( " "). It has Log n complexity :) , Rabin karp can be said as more algorithmic approach whereas contains can be classified as general apporach
bruh you're helping me top the subject in my college i didn't take a single class of💀 tho you are great tbh, may god bless you and yk what? my senior said she will go on a date with me if i top in my class☠☠ so i had the motivation and your resources, thanks for that tho. Stay Healthy lol ASAP
Hey, I know it's too old comment, but for anyone still confused about this , here you go Let's say you have a string window "ABC" , so hash(ABC) = (ascii value of A) * PRIME ^ 0 + (ascii value of B) * PRIME ^ 1 +(ascii value of C) * PRIME ^ 2 Now if we want to get rid of "A" and add "D" to our window, i.e slide our window to "BCD" , we need to update the hash as well, We can do that by removing contribution of "A" from our current hash and add contribution of "D" to our hash. How do we do that? hash(BCD) = [ hash("ABC") - Contribution of "A" ] + Contribution of "D" Contribution of "D" = (ascii value of D) * PRIME^2 So, hash(BCD) becomes, [ hash("ABC") - Contribution of "A" ] + (ascii value of D) * PRIME^2 And now, coming to the contribution of "A" -> Notice that A's value was simply (ascii value of A) since PRIME^0 is always 1 So we can remove the ascii value of A i.e hash(BCD) becomes, [ hash("ABC") - (ascii value of A) ] + (ascii value of D) * PRIME^2 Pay attention to term [ hash("ABC") - (ascii value of A) ] in above equation, its value is now [ hash("ABC") - (ascii value of A) ] = (ascii value of B) * PRIME ^ 1 +(ascii value of C) * PRIME ^ 2 Notice the powers/exponents of PRIME. they start from 1, but we need them to start from 0 since this window is a new one, and every new window should have its hash calculated in same manner as we did while calculating hash(ABC), SO we need to adjust these powers. How to do that ? Well simple maths: Divide by the PRIME once .This would bring every PRIME's power in each term down by 1 So [ hash("ABC") - (ascii value of A) ] / PRIME = (ascii value of B) * PRIME ^ 0 +(ascii value of C) * PRIME ^ 1 SO our complete formula becomes; hash(BCD) = [ hash("ABC") - (ascii value of A) ] / PRIME + (ascii value of D) * PRIME^2
I guess the CalculateHash function will get to the limit of mathematical computations. suppose str.length() is around 1000 It would need to calcu;ate 101^1000 and that is out of bounds of long storage, and I guess pow() too couldn't cacluate it.
Just use a counter variable, and in the condition where all characters match, increase counter by 1. At the end when the loop ends either return or print the value of counter.
since we were multiplying with prime in order to calculate the hash with that character and now since we want to remove that character from our window therefore we need to not just subtract that character but as well divide the new hash with the prime.
Bro actually it takes n-pattern length times iterated and in each iteration it takes two iterations of length of pattern for generating hashcodes and also checking for same characters or not, if hash is matched Finally it also take O(nxm ) time ❤ Tell me if im wrong☺️ But krunal playlist is awesome🧡🧡🧡
@@KunalKushwaha40lpa fraud will refer? LOL made fools out of lakhs of people and that devops course has gone extinct just uploads promotion videos of tools these days.. free free ke chakkar me big scam of trust... fraudster kunal
@@KunalKushwahaYou wont reply to or atleast complete your bootcamp but youll show arrogance for someone asking you a referral politely.. karma hits back fraudster... played games with trust,viral controversies,hype.. and the end result is zero..
@@KaizokuOuNarutowhat karma bro, if you don't like him don't watch his videos. Previously these types of detailed courses were paid, a kind man started it for free while managing his own work, and you're calling him fraud!!!!! Cheap mentality 😞
DSA + interview preparation playlist: ua-cam.com/play/PL9gnSGHSqcnr_DxHsP7AW9ftq0AtAyYqJ.html
If anyone is new to this bootcamp! Let me tell you it's amazing I've completed almost every single videos so far. By the end of the playlist you'll have so much confidence to tackle DSA questions by your own.
Just make sure you're following the notes + assignments & Tips that kunal gives !!
Some tips that I always remember when i approach a problem (kunal has mentioned it)
- Don't memorize, understand the problem / logic
- Hard Question is easy for those who have studied, Easy Question is hard for those who haven't
- The function will return from where it was called !! ( Recursion )
That last thing is the most important
Why is this bootcamp is unique?
It teaches you the thought process of how kunal solves these questions and how you can also get the intuition and approach these problems. Its not just a course where the teacher is just solving and solving questions, rather it helps you build the thought process.
where is graph series kunal sir
Wow, Kunal! Your DSA playlist is absolutely phenomenal. The way you've explained each topic with such clarity and depth is truly commendable. This playlist is hands down one of the best resources for learning DSA on UA-cam. I've been following it for the past two months, and it has been incredibly helpful! However, I noticed that dynamic programming and graphs are yet to be covered. Could you please consider adding these topics? Completing them would make this course the ultimate DSA resource on UA-cam. Thank you so much for your hard work and dedication🙌🤝!
Amazing 👏
Kunal that updateHash method is kind of clever ha!! nice technique!!! Thanks for sharing your knowledge!!!!
please complete Dsa series with graph and DP
These videos are so great, i am also done with each and every video, and just looking forward for notification of new Videos, .... It would be very grateful of Mr. Kunal if he could be more frequent in uploading videos, ❤❤ i don't have much patience for your videos
Best course i suggested many friends ❤❤❤❤
String has a function called contains( " "). It has Log n complexity :) , Rabin karp can be said as more algorithmic approach whereas contains can be classified as general apporach
Ya your right ✅ I'm also thinking we can use contain function to why so use this
Yes but it will give Boolean answer but we need the index
At 2:20 the example ur explaining is sliding window technique with a TC of O(26*N)(for this problem) = O(N)
By the way Big Fan bruh❤️
Ninnu ekkado chusa bhayya
Yes he said its O(n*n) which is wrong
Thanks for the very each and intuitive explanation
Second video on same day❤
Sigma uploaded 2 videos at 3 am
Thanks Kunal!!
bruh you're helping me top the subject in my college i didn't take a single class of💀 tho you are great tbh, may god bless you and yk what? my senior said she will go on a date with me if i top in my class☠☠ so i had the motivation and your resources, thanks for that tho. Stay Healthy lol ASAP
Love from Jashore University of science and technology ,Bangladesh Sir❤. I am from non cs, following you to be a selftaught programmer.
I don't really understand the updateHash function
Hey, I know it's too old comment, but for anyone still confused about this , here you go
Let's say you have a string window "ABC" ,
so hash(ABC) = (ascii value of A) * PRIME ^ 0 + (ascii value of B) * PRIME ^ 1 +(ascii value of C) * PRIME ^ 2
Now if we want to get rid of "A" and add "D" to our window, i.e slide our window to "BCD" , we need to update the hash as well,
We can do that by removing contribution of "A" from our current hash and add contribution of "D" to our hash. How do we do that?
hash(BCD) = [ hash("ABC") - Contribution of "A" ] + Contribution of "D"
Contribution of "D" = (ascii value of D) * PRIME^2
So, hash(BCD) becomes, [ hash("ABC") - Contribution of "A" ] + (ascii value of D) * PRIME^2
And now, coming to the contribution of "A" -> Notice that A's value was simply (ascii value of A) since PRIME^0 is always 1
So we can remove the ascii value of A
i.e hash(BCD) becomes, [ hash("ABC") - (ascii value of A) ] + (ascii value of D) * PRIME^2
Pay attention to term [ hash("ABC") - (ascii value of A) ] in above equation, its value is now
[ hash("ABC") - (ascii value of A) ] = (ascii value of B) * PRIME ^ 1 +(ascii value of C) * PRIME ^ 2
Notice the powers/exponents of PRIME. they start from 1, but we need them to start from 0 since this window is a new one, and every new window should have its hash
calculated in same manner as we did while calculating hash(ABC), SO we need to adjust these powers. How to do that ? Well simple maths: Divide by the PRIME once
.This would bring every PRIME's power in each term down by 1
So
[ hash("ABC") - (ascii value of A) ] / PRIME = (ascii value of B) * PRIME ^ 0 +(ascii value of C) * PRIME ^ 1
SO our complete formula becomes;
hash(BCD) = [ hash("ABC") - (ascii value of A) ] / PRIME + (ascii value of D) * PRIME^2
Which is what Kunal has done in his code.
Hope that helps
I guess the CalculateHash function will get to the limit of mathematical computations. suppose str.length() is around 1000
It would need to calcu;ate 101^1000 and that is out of bounds of long storage, and I guess pow() too couldn't cacluate it.
Inspirational ❤❤❤
no explanation on how to choose prime, why using Math.pow and why dividing old hash
Would this work using something non-prime?
Great video
Thanks, sir!!
GOAT for a Reason....👍
Wah ek sath
what if we need to count that how many times b string contains a
Just use a counter variable, and in the condition where all characters match, increase counter by 1.
At the end when the loop ends either return or print the value of counter.
Cant we just use b.contains(a)?
That also uses an algorithm similar to this one .
I like to say Rabin-karp is it okay
yes
of course he just wanted to be cool about that
Can anyone pls explain why we divide by prime in order to get new hash
since we were multiplying with prime in order to calculate the hash with that character and now since we want to remove that character from our window therefore we need to not just subtract that character but as well divide the new hash with the prime.
@@aveshsingh491
tq so much
not able to understand line no 13
got it
🙏👍
Bro actually it takes n-pattern length times iterated and in each iteration it takes two iterations of length of pattern for generating hashcodes and also checking for same characters or not, if hash is matched
Finally it also take O(nxm ) time ❤
Tell me if im wrong☺️
But krunal playlist is awesome🧡🧡🧡
True 😂😂
👉 Resources
- Join Replit: join.replit.com/kunal-kushwaha
- Lecture code: replit.com/@KunalsReplit/KarpRabin-Hashmaps
Hey kunal can you give a refferal to me
no
@@KunalKushwaha ok but please make a video for how to apply for Google
@@KunalKushwaha40lpa fraud will refer? LOL
made fools out of lakhs of people and that devops course has gone extinct
just uploads promotion videos of tools these days.. free free ke chakkar me big scam of trust... fraudster kunal
@@KunalKushwahaYou wont reply to or atleast complete your bootcamp
but youll show arrogance for someone asking you a referral politely.. karma hits back fraudster... played games with trust,viral controversies,hype.. and the end result is zero..
@@KaizokuOuNarutowhat karma bro, if you don't like him don't watch his videos.
Previously these types of detailed courses were paid, a kind man started it for free while managing his own work, and you're calling him fraud!!!!!
Cheap mentality 😞