I am in mid of CP course of coding ninja and I recently going with topic of number theory and almost mujhay meri kashti dubti nazar aarahi this but is video ne meri kasti sambhal li modulo arithmetic part is awesome for me thank you Utkarsh bhaiya.
hey in your binary exponentiation (pw) function, in the base case if b is 0 then we should return 1 as a^b will become 1 and m is assumed to be greater than 1.
Bhai mujhe bhi 7 star banna hai 😢 jbse tumhari AIR 1 waali video dekhi hai tumhe follow kr rha hu lekin abhi 3 start bna hu 1 mahine mein😎 jaldi hi seven bhi bnunga
Really liked your explanations and proofs for n/1, n/2 , n/3, ....n/n = logn Intuition why sieve inner loop starts at i*i and the way you improved the complexity o(n), o(sqrt(n)), for queries o(n*loglogn) Intuition of mod operations ( +, -, *, /) and why / wont work like other. o(1) calculation of inverse m! ( it looked obvious after you explained XD ) m/m! -> 1/(m-1)!
Hey recently saw your mock interview with kerthi purswani in which you mentioned that hard ques will most probably be not asked in google interviews. Can you make a detailed video about the difficulty level of ques that can be asked in google interviews with examples of some questions so we can get a good idea about the level of ques asked. Also if you could compare them with respect to leetcode medium and hard questions that would be very helpful. Thanks in advance!
Prime or not Prime Number of divisors of each number from 1 to N Sieve of Erastothenes GCD Modular Aritihmetic ( Add, Subtract, Multiply, Pow(Binary Exponentiation), Fermat's Little Theorem to get (1/a)%M we get pow(a,M-2)%M where M is prime number divisor, ) Combinatronics: nCr calculation in linear time using fact and inv_fact array (Usually paired with %M problems)
Hey, could you please make a video on how to setup sublime text for cp on windows. It's really frustating for windows peeps to execute and run programs.
You explained sieve at minute number 22. The inner iteration should rather start from square of i and not just 2i. When you unset all multiples of 2, you're offsetting 4,6,8 and the rest. Notice how these have paved way for remaining 3,5 and 7 to be primes already. So when checking for 3, you should begin with 9 and not 6.
Modular division at 55:35 for these two cases are not returning equal output, a=48521 b=654 m=17 output : 6 11 a=48521 b=654 m=13 output : 9 11 Is it only happening with me? or they do produce different output?
hi utkarsh bhaiyya ,at time 56 : 00 the code is giving wrong output for input a=156 b = 4 and m = 7 could you plz verify it where I can go wrong !! and thank you so much for this amazing video !! just loved it!! plz don't stop ever to make video related to cp
Is it possible to right a number in form of 3^x + 7^y where x and y is any positive integer value. We need to return true or false. Can someone please provide a efficient solution for this question?
Brother, i love to watching your video... But i have a problem, why you don't make a video in hindi... Hum bachee hai bhaiya hindii me explain karoo ge to...or ache se samj ayega...and channel bhi fast grow karega...(padhee ga india to badhega india)💫♥️
how did you change your codeforces cp handle from healthyUG to demoralizer??? i just wrote without thinking much at that time now i want to change it! how to do it can you tell me plz!
Don't stop the DSA/CP series! Amazing video as usual!!
Best Video on number theory by Best of the Community
Bro please make a video on dynamic programming
I think ,he already have some videos on dynamic programming :)
Watch striver's channel
Practice
I really respect the people who add time stamps in their videos
Exactly this is what I m searching for for.
GREAT EXPLANATION
Not all heroes wear capes.. Some make DSA videos on YT.
Thanks brother 🙌
please make more videos please increase the frequency as this is kind of content we want!
He is INDIA RANK 2 Bro
@@shri9229 now 1 🤦♀️
At 45:50, if b==0, you should return 1; this code gives the wrong answer in some test cases. ex= 9 1 7
Thank you.
Waiting for the next video.
By the way, time complexity of gcd is log(min(a,b)).
In 24:03, while explaining sieve of eratosthenes, the upper for loop should go from 2 to i * i
The time complexity is still the same...
Plus my template also stores all of the primes in a vector, so that's why i < N
Got it brother! Thanks for your instant reply!
@@utkarshgupta9858 sun yr, bit manipulation pe bhi sikha de kuxh...
So you mean constant not matter I*i we get const value and for big o for worst case we can't consider constant so it's complexity O(n) times
@@utkarshgupta9858 can u share related problems of these topics
I am in mid of CP course of coding ninja and I recently going with topic of number theory and almost mujhay meri kashti dubti nazar aarahi this but is video ne meri kasti sambhal li modulo arithmetic part is awesome for me thank you Utkarsh bhaiya.
CP course is paid or free?
Please make a video on bit manipulation. Especially on XOR operation
yes , please !
everything about bitwise operator questions in CP
Wow! Modulo inverse and Fermat theorem Explanation I will never forget, ❤❤❤❤.
From where you learn all these things or just while practicing you learn..
Cpalgorithms
pre rmo
hey in your binary exponentiation (pw) function, in the base case if b is 0 then we should return 1 as a^b will become 1 and m is assumed to be greater than 1.
Yes you're right... I made a typo in the code.
Oh finally you are back 😊 :))) much more love to you bhaiya
Hola, Utkarsh Gupta!
Please keep it up this kind of competitive edu series. Thanks!
Bhai mujhe bhi 7 star banna hai 😢 jbse tumhari AIR 1 waali video dekhi hai tumhe follow kr rha hu lekin abhi 3 start bna hu 1 mahine mein😎 jaldi hi seven bhi bnunga
Awesome video!
This is very high quality content, Eagerly waiting for the second part.
Really liked your explanations and proofs for n/1, n/2 , n/3, ....n/n = logn
Intuition why sieve inner loop starts at i*i and the way you improved the complexity o(n), o(sqrt(n)), for queries o(n*loglogn)
Intuition of mod operations ( +, -, *, /) and why / wont work like other.
o(1) calculation of inverse m! ( it looked obvious after you explained XD ) m/m! -> 1/(m-1)!
just the person I was looking for, thanks 🙌
Person or video? 😛
@@utkarshgupta9858 Ig the "person" who can make many such "videos".
How come we feel the same ❤️❤️ the one I was looking for
Your explanations are great. Well done!
Hey recently saw your mock interview with kerthi purswani in which you mentioned that hard ques will most probably be not asked in google interviews. Can you make a detailed video about the difficulty level of ques that can be asked in google interviews with examples of some questions so we can get a good idea about the level of ques asked. Also if you could compare them with respect to leetcode medium and hard questions that would be very helpful. Thanks in advance!
Literally bhaiya I was finding this type of video for 2-3 days and nothing got quality content like this
Thanks a lot
Aapne meri sun li
Prime or not Prime
Number of divisors of each number from 1 to N
Sieve of Erastothenes
GCD
Modular Aritihmetic (
Add,
Subtract,
Multiply,
Pow(Binary Exponentiation),
Fermat's Little Theorem to get (1/a)%M we get pow(a,M-2)%M where M is prime number divisor,
)
Combinatronics: nCr calculation in linear time using fact and inv_fact array (Usually paired with %M problems)
SIR UR DOING GREAT JOB FOR US ...THANKU PLEASE MAKE MORE THIS VIDEOS .WE GET TO LEARN MANY THINGS FROM IT
Today i start cp and learning from grandmaster directly.. like wow this is amazing! Lot of resp++
This is the thing I was waiting from past 4 years
Hey, could you please make a video on how to setup sublime text for cp on windows. It's really frustating for windows peeps to execute and run programs.
Checkout Luv competitive programing course playlist.The second video completely about setup Link: ua-cam.com/video/Zlx7gmt3lBU/v-deo.html
@@humanbeing6042 I have already seen it. But not able to setup from his way. I am not able to make my custom build file and stuck forever :(
You can use WSL to get the linux experience on windows
Please make one whole video explaining time-complexity also.
You explained sieve at minute number 22. The inner iteration should rather start from square of i and not just 2i. When you unset all multiples of 2, you're offsetting 4,6,8 and the rest. Notice how these have paved way for remaining 3,5 and 7 to be primes already. So when checking for 3, you should begin with 9 and not 6.
UPDATE: Sorry for commenting too soon. You explained this just 10 seconds later.
for prime approach would this be not much faster ?
bool isPrime(int N) {
if(N==1){
return false;
}
int count = 0;
for(int i = 1; i*i
removing the nested if won't reduce the time complexity it will still be O(root(n))
Thank you Bhaiya...
Modular Arithmetic part taught me something new.. 😊
27:50
time complexity should be O(log(min(a,b)))
correct me if I am wrong
thanks for explaining modulo arithmetic in full details !!! great work
Just the content I was looking for !
Thank you for the video
Crisp and to the point content. Well Done.
How to setup sublime like that in 5:30 , the TC part ?
Nice, bro long time no see. I was waiting.....
primality test 3:27
gcd 24:37
modular arithmetic 30:52
pnc 59:04
Gread content Grandmaster. Keep uploading. 🤝
You are inspiration for me ❤️✨
Please make a video for greedy it is very helpful
How you've managed your hectic curriculum of college with the immense practice of cp? Please reply!
What hectic ciriculum of college 🤣🤣r u joking ,nothing hectic ,it's chil
very nice explanation, just adding the practice questions related to the concepts would be even better.
in pw(a, b, m), when b is 0, why are you returning a % m? it should always be 1 right?
Oh right yeah... I think I mistyped that part... And the tests didn't fail🤦🏻♂️
I hope learners don't get confused. Thanks for pointing out
I used to dread Modular multiplicative inverse. Not anymore 😌
42:21 shouldn't base case return 1
Bhaiya plS make video on how to Start for CP.. How should we learn Dsa correcr way
can you please give practice problems on Maths part in DSA
after so long
wating for this video
if you prefer a textbook, consider the competitive programmers handbook :)
At 23:55 that sieve template, how the whole template code arrives just by typing sieve?
Modular division at 55:35 for these two cases are not returning equal output,
a=48521 b=654 m=17
output : 6 11
a=48521 b=654 m=13
output : 9 11
Is it only happening with me? or they do produce different output?
the nlogn proof was amazing
Thanks for this. It really helps me a lot .
Hwy, plz make video on time complexity. Thk yu for helping us
Searching and sorting and precomputation
this video changed my life beta 👌👌👌👌👌👌👌👌👌👌👌👌👌👌👌👌👌👌👌👌👌👌👌👌
Bro please tell how to make sublime like yours
Amazing content, as usual!
Thank you sooo much!!!
kindly continue with Graph series
The Speed at which complier is working and Set-up is made
....i am desparately waiting when that content would be Up on channel 🙂🤝💔
Nice explanation
This is perfect lecture
Please update this slide
Thank you LORD DEMORALIZER
this changed my cp career ❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤😍😍😍😍😍😍😍😍😍😍
thanks, ❤ bhaiya I wanted this type of video.
casually explaining sieve of erathosthenous
Grt video. Please share some problem set to practice
🔥🔥
Most awaited video♥️♥️
Bro Dynamic Programming Playlist Is Needed
Sir please make video on dp and graphs from basic to advanced
hi utkarsh bhaiyya ,at time 56 : 00 the code is giving wrong output for input a=156 b = 4 and m = 7 could you plz verify it where I can go wrong !! and thank you so much for this amazing video !! just loved it!! plz don't stop ever to make video related to cp
i made a small mistake in the code, if power is zero, we should return 1 instead of a.
@@utkarshgupta9858 ok thank you bhaiyya!!
Amazing Video.
Purple is my aim for this year.
Bhaiya other topics ki bhi detailed videos bana do please jo cp mei important hote hai..🙏
Can someone please tell me which software he used to create thie presentation please
i thought i know very lesss but after seeing todays video i understand i know all topics he discuss today and even more he not add
Where u learn all this things
@@AjithKumaR-jw9wt few days ago and still learning , if u want to understand number theory try code n code number theory playlist
@@035asadali8 bro any prerequisite to learn number theory
@@035asadali8 what are the topics we want to cover in dsa before cp
@@AjithKumaR-jw9wt for number theory no prerequisite needed
thank you very much! very helpfull!
I have one doubt if we multiply a number it gets overflow and if we add also it gets overflow but if we divide a number how it will get overflow
Awesome class!
Hello brother ! Please make a video on how to setup Sublime text as you had in your laptop
Is it possible to right a number in form of 3^x + 7^y where x and y is any positive integer value.
We need to return true or false.
Can someone please provide a efficient solution for this question?
Please Use black background (dark mode)
sir can you please tell me from where you learned all this topics??
Great Lecture Bro!
Brother, i love to watching your video...
But i have a problem, why you don't make a video in hindi...
Hum bachee hai bhaiya hindii me explain karoo ge to...or ache se samj ayega...and channel bhi fast grow karega...(padhee ga india to badhega india)💫♥️
Are JOD sir 🤩
but usually we have mod as 10^9+7 so how are we gonna calculate the multiplicative inverse. b^m-1. ...blaaaaaa
You're awesome 🙌
why you have declared fact[N], but it should be fact[N+1] because we also have to store factorial of N
simply awesome
bhai complete course bana de pls
udemy pe daal dena par complete course bana de
how did you change your codeforces cp handle from healthyUG to demoralizer??? i just wrote without thinking much at that time now i want to change it! how to do it can you tell me plz!
Bro please make a video on your sublime text setup of U .
please add graph videos also like this one