Pre-Computation Techniques Basics & Hashing | Competitive Programming Course | EP 12

  Рет қаралды 184,434

Luv

Luv

Күн бұрын

Пікірлер: 275
@iamluv
@iamluv 4 жыл бұрын
at 4:42 , i forgot to take modulo when storing factorial in array, line number 21 at 4:42 should be fact[i] = (fact[i-1] * i ) % M;
@unityleveldesign4878
@unityleveldesign4878 3 жыл бұрын
Mai bhi yahi comment karne ke liye aya tha per dekha ki appne pahle hi comment me pin kar ke rakkha hai, salute you LUV Bhaiya.
@quirtt
@quirtt 3 жыл бұрын
@@unityleveldesign4878 orz
@005lemdshahbazkhan2
@005lemdshahbazkhan2 3 жыл бұрын
Bro dry run krk btaya kro yrr
@psibarpsi
@psibarpsi 3 жыл бұрын
15:21 Why can't we just have a local hash array with size n (input by user)? It would have a better space complexity as compared to the given code.
@darshantawte7435
@darshantawte7435 3 жыл бұрын
@@psibarpsi It is basically done to avoid passing arrays to functions which is a hassle. And in reality companies never use global arrays in software development but in competititve programming no one cares to optimize space if your answer is accepted by the coding platform.
@mohitshrivastava8897
@mohitshrivastava8897 4 жыл бұрын
Bro, The content is so good that I felt guilty of skipping the ad. so I played the entire 2 ads of 2 min each :D. I urge every one to do the same as a gesture of appreciation and gratitude. Thnx again!
@iamluv
@iamluv 4 жыл бұрын
Haha.. I earn well from my Full Time job, i don't do youtube for money, The ad revenue whatever little it is there is used to improve content quality on youtube. Thanks for your support ❤️
@mohitshrivastava8897
@mohitshrivastava8897 4 жыл бұрын
@@iamluv I know Directi pays well but just my token of respect towards you❤️
@rishikaarora8267
@rishikaarora8267 3 жыл бұрын
​@@mohitshrivastava8897 Directi pays him for his job. There was no sense of mentioning this in comment that you skipped ads or not. You don't know how hard he is actually working for managing this youtube channel along with job. If you genuinely said that for any kind of support then it's good. But if that was for discouraging him then it's better you make a new playlist for us without ads. :)
@mohitshrivastava8897
@mohitshrivastava8897 3 жыл бұрын
@@rishikaarora8267 Wow... Amazing how one can find the comment as discouraging ( specially when Luv replied with "haha", and acknowledged the comment)🙄. Stop looking at everything through a cynical lens, the world will be a better place... Trust me. Peace ✌️
@prashantdwivedi1736
@prashantdwivedi1736 3 жыл бұрын
@@mohitshrivastava8897 Mai bhi vahi soch raha tha....isme kya offend hua ye
@harikrishnan204
@harikrishnan204 4 жыл бұрын
bro i am loving your CP series..keep up the great work! Looking forward to more videos in this series
@itz_me_imraan02
@itz_me_imraan02 4 жыл бұрын
🔥 wish this playlist becomes the best for CP
@vivekshelke9788
@vivekshelke9788 4 жыл бұрын
This is
@rickk3300
@rickk3300 3 жыл бұрын
Bro, this is the best playlist ever for CP
@priyeshtandel2101
@priyeshtandel2101 Жыл бұрын
Building more interest...😇
@vaibhavis1
@vaibhavis1 4 жыл бұрын
You are doing nice work buddy, unlike other KZbinrs of similar type. Be like this, natural, direct, and no nautanki. :)
@darshantawte7435
@darshantawte7435 3 жыл бұрын
The best thing about this course is the structured format. I never knew when to use precomputation until now.
@devilgaming6182
@devilgaming6182 13 күн бұрын
Practice Question 9: bool containsDuplicate(vector& nums){ map mp; for(int i = 0;i < nums.size();i++){ mp[nums[i]]++; if(mp[nums[i]] > 1) return true; } return false; }
@amanrubey
@amanrubey 4 жыл бұрын
So many people's future is resting on your shoulders. Thank you sir. It is making an impact.
@HDbIce-oj3wv
@HDbIce-oj3wv 4 жыл бұрын
Top Notch ❤
@anshupandey1782
@anshupandey1782 4 жыл бұрын
kal hi contest me pre-computation ka question nahi hua aaj aapka video aa gya :)
@saismrutik8101
@saismrutik8101 4 жыл бұрын
Your explanations are priceless bhai Keep going and please complete this series whatever happens♥️
@devilgaming6182
@devilgaming6182 12 күн бұрын
Practice Question 11: const int N = 6e4 + 1; int singleNumber(vector& nums){ int ans, ash[N] = {0}; for(int i = 0;i < nums.size();i++) ash[nums[i] + 30000]++; for(int i = 0;i < nums.size();i++) if(ash[nums[i] + 30000] == 1) ans = nums[i]; return ans; }
@abhishekhorton79
@abhishekhorton79 3 жыл бұрын
It's something called memoization which is used to solve DP problems Apart from that, I'm enjoying your playlist you're doing great work for students like me, please complete this series ☺
@codeguy21
@codeguy21 2 жыл бұрын
bro i have a doubt why are we taking long long fact[N] outside int main why not inside ?
@uraharakisuke5305
@uraharakisuke5305 2 жыл бұрын
@@codeguy21 cause the number of elements you can store inside an array which is declared locally in some function is of the order of 10^5, whereas if you declare array globally, then the number of elements you can store is around 10^7.
@suyashrahatekar4964
@suyashrahatekar4964 4 жыл бұрын
Bhai itna organised aur quality CP / c++ course shayad hii koi provide kar sake.
@darshantrivedi5390
@darshantrivedi5390 4 жыл бұрын
Thanks bhai You are great 💯💯
@yourbestie4138
@yourbestie4138 4 жыл бұрын
Today is Guruvar and your our favorite Guru(teacher)💗😍👌
@nityasingh8276
@nityasingh8276 4 жыл бұрын
Oh god i was about to learn pre computation and here comes your video. 🌻
@Siddharth_Nayak_official
@Siddharth_Nayak_official Жыл бұрын
Really loved your content luv...u r helping me...thanks biro❤❤❤
@EhsaasMohabbat
@EhsaasMohabbat 3 жыл бұрын
great voice aur samjhane ka level bohot hi badiya hai sir apka! impressed.. first time watching but now onwards i will watch all videos of yours to learn competitive programming..
@de_ansh
@de_ansh 3 жыл бұрын
I started late with competitive programming , but your videos have been great help . Thank you so much sir
@letsOpenOurEyes3
@letsOpenOurEyes3 2 жыл бұрын
at 17:25, code run time in terminal showing 7.0 sec instead of run within 1 sec ?How? Does it depends upon system?Please explain sir.
@shaantyagi2187
@shaantyagi2187 3 жыл бұрын
dimag khul gya bhai maja aa gaya. Well done and thanks !
@bikramdas3157
@bikramdas3157 3 жыл бұрын
Best tutorial for CP luv vaiya. Lots of love for you vaiya❤️
@iRafi077
@iRafi077 Жыл бұрын
it was this moment I realized why cp in actually imp. thank you! take love from Bangladesh!.
@abhishekvishwakarma9045
@abhishekvishwakarma9045 4 жыл бұрын
Ek number bhai 🔥🔥👌 best video on pre-computation for beginners lage raho😎
@shawonhussain07
@shawonhussain07 8 ай бұрын
15:15 const int N = 1e5+10; am i right? BTW love from BD
@syedmunawaralirazvi2002
@syedmunawaralirazvi2002 4 жыл бұрын
You teach really in a fantastic way....................FAN of your teaching skills 👌
@stevefox2318
@stevefox2318 4 жыл бұрын
Going to become best KZbin channel for CP
@DashingChannel
@DashingChannel 6 ай бұрын
Your content is gem 💎
@kinggamer11006
@kinggamer11006 3 жыл бұрын
Isme function bna kr while t-- me passs bhi to kr skte the
@sahilDa997
@sahilDa997 4 жыл бұрын
you are a genius bhaiya keep doing this..
@aayush5474
@aayush5474 4 жыл бұрын
Explanation is best!
@devilgaming6182
@devilgaming6182 13 күн бұрын
Practice Question 4: const int N = 1e6 + 1; long long int pf[N]; int sumSubSubarray(vector& arr, int k){ long long int ans = 0; for(int i = 1;i
@anmol3
@anmol3 Жыл бұрын
You can use "hashmap" instead of hash arrays if the value exceeds 10^7
@vibhorgautam9928
@vibhorgautam9928 4 жыл бұрын
Great video bhaiya!!
@VikashKumar-uy9ge
@VikashKumar-uy9ge 2 жыл бұрын
Amazing explanation
@abhaychaturvdi
@abhaychaturvdi 3 жыл бұрын
best tutorial for cp
@kishanpatel3354
@kishanpatel3354 3 жыл бұрын
Too good, thanks man!
@iamdj8540
@iamdj8540 3 жыл бұрын
bro same hashing technique, we use in count sort for sorting array
@vedantgolash6084
@vedantgolash6084 2 жыл бұрын
amazing luv bhai 👌🏻
@manishkasera8584
@manishkasera8584 2 жыл бұрын
Ek number
@surjeetsingh-cp6hn
@surjeetsingh-cp6hn 3 жыл бұрын
Quality content as always
@navendraagrawal
@navendraagrawal 3 жыл бұрын
I was using hashing from a long time and didn't knew that it is called hashing 😂
@JesanKhan-gc6sr
@JesanKhan-gc6sr Ай бұрын
Same bro
@developskills9253
@developskills9253 3 жыл бұрын
one day u get the luv 💓 from whole world
@attadaramprasad1228
@attadaramprasad1228 3 жыл бұрын
Sooo nice explanation bro...
@oyeeyedhaikilokahathh3370
@oyeeyedhaikilokahathh3370 3 жыл бұрын
Bhai you are legend ❤️
@AgnivaBanerjee6
@AgnivaBanerjee6 3 жыл бұрын
Thank you!
@entertainmentworld5276
@entertainmentworld5276 4 жыл бұрын
Awesome.. ♥️♥️
@shivamkumarmahato3409
@shivamkumarmahato3409 4 жыл бұрын
Awesome Explanation. Love you from Nepal 💗😍👌
@rahulkadam6655
@rahulkadam6655 3 жыл бұрын
Thanks a lot 💯😄
@dakshnaik476
@dakshnaik476 4 жыл бұрын
Thank you!!!👌🏻👌🏻👍🏻
@ShubhamPandey-st4nn
@ShubhamPandey-st4nn 3 жыл бұрын
Superb
@VaishnaviNigam
@VaishnaviNigam 3 жыл бұрын
LIKE SERIOUSLY ??? SO CLEAR SO CONCISE I MEAN SPEECHLESS ......... HATS OFF LUV SIR 😍😍😍 BESTEST EVER PLAYLIST FOR CP
@sahilnegi2789
@sahilnegi2789 3 жыл бұрын
Bhai apsa ek bar life ma milna chahenga apna meri bhut help ki hai . thnks again
@joeljacob4685
@joeljacob4685 4 жыл бұрын
Nailed it👍🏻
@devilgaming6182
@devilgaming6182 18 күн бұрын
15:45 what if a[i] is negative.
@SumanKumar-mx1cq
@SumanKumar-mx1cq 3 жыл бұрын
Thank you
@irfanquader3944
@irfanquader3944 4 жыл бұрын
great content bhaiya
@stocks4Trading
@stocks4Trading 3 жыл бұрын
Love You Luv Bhaiya
@reetpriye8807
@reetpriye8807 4 жыл бұрын
Thanks bro🙏💕
@atharvakulkarni3007
@atharvakulkarni3007 4 жыл бұрын
Mast explanation 😍
@brandedmunda6281
@brandedmunda6281 3 жыл бұрын
Best vieeo for beginners
@AmitKumar-zm3vt
@AmitKumar-zm3vt 2 жыл бұрын
In the hashing question discussed, since range of array is positive , if it will be negative then, how to calculate it ?
@sagnikdas1780
@sagnikdas1780 3 жыл бұрын
Thank you bhaiya
@TheBold-je8ci
@TheBold-je8ci 3 ай бұрын
N ki value upr "1e5" h toh fir program likhta vhkt const int N ko " 1e7 + 10 " ku declare Kiya? Timing : 15:15
@babarazam56569
@babarazam56569 2 жыл бұрын
you are joss vai!🥰
@mohdaasimqureshi7115
@mohdaasimqureshi7115 4 жыл бұрын
keep going bhaiyya
@sushmapandey7145
@sushmapandey7145 3 жыл бұрын
12:36 we can use map also
@iamluv
@iamluv 3 жыл бұрын
Firstly i havent taught map untill this lecture hence not using it, secondly its faster to use array based hashing whenever its possible to do so, its faster than using maps.
@sushmapandey7145
@sushmapandey7145 3 жыл бұрын
@@iamluv thanks bhaiya for this information.
@Nirala_414
@Nirala_414 3 жыл бұрын
Simply great work Bhaiya... Mere ko pata na kitna khusi ho Raha aapke channel milne se .... Thankyou for your hard work
@ankurpandey_0122
@ankurpandey_0122 3 жыл бұрын
Thanks bro
@prathameshkinagi3720
@prathameshkinagi3720 4 жыл бұрын
Thanks
@nolan9546
@nolan9546 4 жыл бұрын
Bhai Finally I got the exact medicine as I decided to follow your tutorial. Lots of Love Bhai.
@md.annahianprince9180
@md.annahianprince9180 Жыл бұрын
In 2024 this is very good video for programmers!😍
@Faisal_89
@Faisal_89 2 жыл бұрын
best bhai
@yutaitadori7318
@yutaitadori7318 3 жыл бұрын
Wow♥️🔥
@siddharthsahu7185
@siddharthsahu7185 3 жыл бұрын
love you bro
@Raj-fi5ui
@Raj-fi5ui 4 ай бұрын
Map also do the same work as hashing right?? Calculating frequency of elements ?
@KCOMohammadRehmaan
@KCOMohammadRehmaan 3 жыл бұрын
Bhai please playlist ko beech me adhoora mat chhodna we all are really loving it please isko continue rakhna.
@zafdell8170
@zafdell8170 4 жыл бұрын
Mja aa gya 😀😃🤣☺
@october3518
@october3518 3 жыл бұрын
I am quite overwhelmed ryt now.... this is the third time I have found a treasure in my programming journey! truly sparking my curiosity and intrest in cp ! Thankyou for the good content :-)
@maycodes
@maycodes 3 жыл бұрын
Please do a video on CP templates
@rahulbera454
@rahulbera454 4 жыл бұрын
Thanks bro 🔥🔥🔥 amazing video
@aryanverma7800
@aryanverma7800 4 жыл бұрын
pls upload practise problems also sir
@iamluv
@iamluv 4 жыл бұрын
next video me daal dunga
@Agent_Ax
@Agent_Ax 3 жыл бұрын
Bhaiya Maine Map Use Kia Aur map[n]+=1; Then Printing map[n] question ke lie ye chalega kya?
@iamluv
@iamluv 3 жыл бұрын
haa vo bhi chlega.. is point maps ke btaya hai furure ki videos me jha map pdhaya vha ye sab bhi btaya hai also for hashing its better to use unordered_map as compared to normal map. Watch maps videos for details
@FaisalKhan-oy4zz
@FaisalKhan-oy4zz 4 жыл бұрын
🔥
@kamalkumar945
@kamalkumar945 3 жыл бұрын
bhaiya please ye series continue rakhna ICPC level tak
@kiku_to_herself
@kiku_to_herself 3 жыл бұрын
Loved ittttttt
@deviltvpublication922
@deviltvpublication922 3 жыл бұрын
Best explanation about precomputation technique🔥
@romanrai2507
@romanrai2507 3 жыл бұрын
Well , This is the Best series watched till now.
@GANESHSINGH-oe2wy
@GANESHSINGH-oe2wy 3 жыл бұрын
🙏🏻 🙏🏻Sir, aap padhate waqt highlight krne ke liye konsa softwate use krte ho (jo laser jaisa dikhta hai phir apne aap gayab ho jata hai) 🙏🏻🙏🏻
@sbndBhanu546
@sbndBhanu546 11 ай бұрын
yes sir but in this case space compexity increase know to O(n) so then is it good in cp
@adarsh6109
@adarsh6109 2 жыл бұрын
🔥🔥🔥🔥🔥🔥🔥
@shajidulislam2783
@shajidulislam2783 2 жыл бұрын
I just wanted to know if the problems given in the description can be solved with the technics shown in this video or do I need to watch other precomputation technics too?
@Rahulkumar-op9lu
@Rahulkumar-op9lu 4 жыл бұрын
Bro if size of care is 1e9+ then what will u r approach for that....for 0(n) ....
@iamluv
@iamluv 4 жыл бұрын
if you want o(n) in those cases then your have to write custom hash functions or you can use unordered maps which do the same.
@aadityasharma6855
@aadityasharma6855 3 жыл бұрын
Loving your videos, please continue this series. Thanks a lot
@SumanKumar-mx1cq
@SumanKumar-mx1cq 3 жыл бұрын
Sir good typing
@devilgaming6182
@devilgaming6182 13 күн бұрын
Practice Question 10: const int N = 26; int te; cin >> te; string s, t; while(te--){ cin >> s >> t; int S[N] = {0}, T[N] = {0}, steps = 0; for(int i = 0;i < s.size();i++) S[s[i] - 'a']++; for(int i = 0;i < t.size();i++) T[t[i] - 'a']++; for(int i = 0;i < N;i++) steps = steps + abs(S[i] - T[i]); cout
@veerusingh1981
@veerusingh1981 3 жыл бұрын
Bhiya pre computation Kay liya hum COUNT() function nhi use kr saktey ??? Last hashing wale question may
@devilgaming6182
@devilgaming6182 15 күн бұрын
Practice Question 2: const int N = 1e5 + 10; class Solution{ public: vector findMissing(vector& a, vector& b){ int ash[N] = {0}; vector ans; for(int i = 0;i < b.size();i++){ ash[b[i]]++; } for(int i = 0;i < a.size();i++){ if(ash[a[i]] == 0){ ans.push_back[a[i]]; } } } };
Mom Hack for Cooking Solo with a Little One! 🍳👶
00:15
5-Minute Crafts HOUSE
Рет қаралды 23 МЛН
Enceinte et en Bazard: Les Chroniques du Nettoyage ! 🚽✨
00:21
Two More French
Рет қаралды 42 МЛН
“Don’t stop the chances.”
00:44
ISSEI / いっせい
Рет қаралды 62 МЛН
7 Outside The Box Puzzles
12:16
MindYourDecisions
Рет қаралды 483 М.
C++ Hash Table Implementation
17:41
Coding Jesus
Рет қаралды 196 М.
Maps in C++ (std::map and std::unordered_map)
30:00
The Cherno
Рет қаралды 230 М.
Prefix Sums - Problems, Code in C++ & Python
20:51
Errichto Algorithms
Рет қаралды 60 М.
Mom Hack for Cooking Solo with a Little One! 🍳👶
00:15
5-Minute Crafts HOUSE
Рет қаралды 23 МЛН