Pre-Computation using Prefix Sum in 1D/2D Arrays | Competitive Programming Course | EP 13

  Рет қаралды 180,526

Luv

Luv

Күн бұрын

Пікірлер: 288
@iamluv
@iamluv 4 жыл бұрын
at 18:37 its pf[i][j-1] instead of pf[j][i-1]
@Raj_Tanvar
@Raj_Tanvar 3 жыл бұрын
Isi mistake ko point out karne ke liye मैं comment section me aaya tha... But as always आपने पहले ही pin kar rakha tha... Mujhe chance नहीं मिला 😂😂😒
@EhsaasMohabbat
@EhsaasMohabbat 3 жыл бұрын
u already made us understood very clearly, so now u can code it !
@vinit5289
@vinit5289 2 жыл бұрын
at 3:13 how can we store something at a[n] at i=n
@adarshchaudhary7811
@adarshchaudhary7811 2 жыл бұрын
@@vinit5289 take a[N] . its not a[n]
@rajeeell
@rajeeell 2 жыл бұрын
@@Raj_Tanvar wow so funny maza a gaya😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂😂
@exam_dost
@exam_dost 3 жыл бұрын
your first 10 videos are enough for whole competitive programming course. I have seen lots of competitive programming tutorial but the specific cp tricks are shown by you only. Amazing man. IIIT guys are known for their deep knowledge is real.
@TheArchit1
@TheArchit1 3 жыл бұрын
🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣
@vinit5289
@vinit5289 2 жыл бұрын
at 3:13 how can we store something at a[n] at i=n
@sougatasingha9587
@sougatasingha9587 2 жыл бұрын
@@vinit5289 bro he create a global array called "a" and its size was 10^7 a[N] where N=10^7 and he took "n" as user input so he can store upto 10^7 element in that array
@vinit5289
@vinit5289 2 жыл бұрын
@@sougatasingha9587 thanks
@itz_me_imraan02
@itz_me_imraan02 4 жыл бұрын
Your videos are addictive 🔥
@EhsaasMohabbat
@EhsaasMohabbat 3 жыл бұрын
yes really!!! same here..
@rickk3300
@rickk3300 3 жыл бұрын
Correct bro..😂😊👍
@shrishtijain3788
@shrishtijain3788 3 жыл бұрын
Same here🔥🔥
@sarvaswamohata9693
@sarvaswamohata9693 Жыл бұрын
2 years and still it remains the best available resource for cp over the internet❤❤
@yourbestie4138
@yourbestie4138 4 жыл бұрын
always on time - your video uploading time complexity is O(1) and space complexity is O(full of knowledge)😁
@abhishekanantharam645
@abhishekanantharam645 4 жыл бұрын
Kya baat hai😂 Kal hi I encountered a 2D prefix sum based problem in a test. Appreciate your effor bro thanks💥
@aviralsrivastava3409
@aviralsrivastava3409 4 жыл бұрын
Best. Course. Ever.
@TheArchit1
@TheArchit1 3 жыл бұрын
😂😂😂😂😂😂😂
@husandeepsingh3616
@husandeepsingh3616 3 жыл бұрын
i started this playlist a week ago I really learned a lot until now and will keep learning more from this channel really liked the lectures
@sawandeepgavel54
@sawandeepgavel54 3 жыл бұрын
That prefix sum of 2-D array was tricky and you explained it ingeniously...... ❤️❤️
@barnikroy5244
@barnikroy5244 4 жыл бұрын
Btw......bhaiyyaaa ye course 2 lakh ka he because of tutoring plus problems......total package......aap please paisa ka matt sochna......aap ke job aisahi bohot paying he.......ye aapke couse aapke liye poor students ko gift he........you are one of those best persons still prevailing on this earth
@aryanverma7800
@aryanverma7800 3 жыл бұрын
bro you will not get such course even after paying money.......its not about rich poor........if you can buy a laptop, pay engineering fees then you can also pay 10-15k for a good course
@silverzero9524
@silverzero9524 3 жыл бұрын
@@aryanverma7800 laptop aur fees bhara isliye hi paisa nahi bacha lol bohot high fees hai yaar engineering college ki aur education bilkul worth nahi utna
@jhashivam28
@jhashivam28 4 жыл бұрын
Bestest ever competitive coding course on the internet 🔥👍
@AshokKumar-ix4nf
@AshokKumar-ix4nf 3 жыл бұрын
Bhaiya aapke karan mujhe Cpp se pyar ho gya thanks.... Yt me bahut saare lectures h but aapke explanation ka koyi jawab nhi isi tarah video's bnate rahye.. 🤗🤩
@ShubhamChhimpa
@ShubhamChhimpa 4 жыл бұрын
Must say you explained this in the best way.
@TheArchit1
@TheArchit1 3 жыл бұрын
🤣🤣🤣🤣🤣
@kartikforwork
@kartikforwork Жыл бұрын
@@TheArchit1 🤣🤣🤣🤣🤣🤣🤣
@subratkumar1001
@subratkumar1001 16 күн бұрын
Happy new year sir, it's new year night and i'm watching your lectures. these lecture qualities are way above than others. please sir continue the lecture series for advanced CP (acm icpc, etc). you are amazing sir.
@thegreekgoat98
@thegreekgoat98 3 жыл бұрын
My heart cries when educator like this aren't famous enough. Man, I challenge everybody here, if anybody show me better coding teacher than him, I will change my name..
@Rafiqul.Islam4
@Rafiqul.Islam4 3 жыл бұрын
Your videos are awesome... You not only help Indian students but also Bangladeshi students... One of my Indian cousin recommended me your playlist. And your way of teaching is on point. And I also shared it to my friend zone & they also liked it. Please continue this & we really enjoy your teaching.....
@harshitrathi3077
@harshitrathi3077 4 жыл бұрын
Was Waiting For This Video..... Thankyou Bro.... Keep On uploading more videos on CP
@mohammadAmmar71
@mohammadAmmar71 3 жыл бұрын
bro you are the pioneer of cp for me,,btw God bless u..love from Bangladesh/
@AppaniMadhavi
@AppaniMadhavi Жыл бұрын
At 7:20 luv proved that he is a logical thinker.👏👏
@uditkatyal5090
@uditkatyal5090 Жыл бұрын
those who are getting confused with size of prefix array - for 1 based approach u must take N+1 size of array to accomodated nth index unless it will give segmentation fault (accessing the memory which we don't have)
@riyayadav2362
@riyayadav2362 27 күн бұрын
8:30 He had already taken N greater than the given value of N So we can access the nth index of pf without the segmentation fault. It had taken my 15 min to understand 😵‍💫
@stevefox2318
@stevefox2318 4 жыл бұрын
just amazing you're doing great luv
@TheArchit1
@TheArchit1 3 жыл бұрын
😂😂😂😂😂
@shridharsarraf2188
@shridharsarraf2188 3 жыл бұрын
Luv bro, explains the most important things in the most easiest way. I'm observing growth in my CP skills, just in a week😄
@sidhantnahak4481
@sidhantnahak4481 Жыл бұрын
Literally after watching your videos confidence is getting high towards cp
@AsuBeats
@AsuBeats 3 жыл бұрын
Crystal Clear Explanation! Best for Beginners to grab the concept!
@TheArchit1
@TheArchit1 3 жыл бұрын
😂😂😂😂😂😂
@vinit5289
@vinit5289 2 жыл бұрын
at 3:13 how can we store something at a[n] at i=n
@lakshmisravyak5517
@lakshmisravyak5517 3 жыл бұрын
you are gem,really informative ,you helped me alot in improving my problem solving approach
@swapnilkashyap3188
@swapnilkashyap3188 2 жыл бұрын
Really appreciate the kind of hard work you have put to compile such high quality videos, n that too free. Hats off man.
@sagarbarpanda8749
@sagarbarpanda8749 2 жыл бұрын
I am loving the course. Just a minor comment in this: In 1d array prefix sum, you have taken elements as int pf[n]. I think it should be long long int pf[n] as taken for 2d. It can exceed the int values.
@good114
@good114 2 жыл бұрын
Thank you Bhaiya 🙏🙏🙏♥️♥️
@funenjoynilaypatel4553
@funenjoynilaypatel4553 2 жыл бұрын
IIIT guys are known for their deep knowledge is real.
@shreyasnaphad3284
@shreyasnaphad3284 3 жыл бұрын
Wow! This is awesome man!!! Keep on making videos on CP.
@Aditya_singh413
@Aditya_singh413 7 ай бұрын
11:44 didnt get how the loop will go from a to c and b to d????????????????????????
@mdshadan-7312
@mdshadan-7312 3 жыл бұрын
Your channel is on of the best programming hindi channel
@TheArchit1
@TheArchit1 3 жыл бұрын
🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣
@towhidhasan7426
@towhidhasan7426 Жыл бұрын
I am from bangladesh, you video is very much informative and clear to understand. Thank you so much. Go ahead
@itsmesohit
@itsmesohit 3 жыл бұрын
Great explanation brother 💙
@ManishKumar-px1wv
@ManishKumar-px1wv Жыл бұрын
Love to watch this video. Thanku very much
@tarunchauhan1025
@tarunchauhan1025 3 жыл бұрын
I love the way you teach and explain..... Thanks Bhaiya..... Keep uploading video .....
@moonwalkingdancer8369
@moonwalkingdancer8369 2 жыл бұрын
i shud agree man that after watching this i solved 5 leet codes on my own thnks a lot
@tusharsaxena8239
@tusharsaxena8239 4 жыл бұрын
keep up the good work bhaiya, maza aa gaya
@shivamkumarmahato3409
@shivamkumarmahato3409 4 жыл бұрын
Bhaiya please start vector ASAP... Qki avi tak itna vector ka video dekh liya hu concept clear nhi hua hai.....m damn sure ki aapki video se ache se clear ho jayega... Isliye so excited for that topic... The way of ur teaching awesome.... Even nit/IITian teacher failed... 🥰🥰 Love u from Nepal 🇳🇵 ❤❤❤
@iamluv
@iamluv 4 жыл бұрын
krke bhai stl shuru krne sephle basics kaafi cover krne hai.. nhi to ache se smj nhi ayega sbko
@shivamkumarmahato3409
@shivamkumarmahato3409 4 жыл бұрын
@@iamluv ok bro.. Nop problm... Itna kar rahe ho yeah v kaafi hai... Aur please ek baar topic ka ek sample sa roadmap bata do taaki aapki video aane se pehle woh topic ko leke todha google kar k padhlu basics knowledge le lu phir aapka video dekhu taaki uss time aur v ache se samajh aaye... Bas ek baar bata do aap kaun kaun si topic cover karoge...?? Please🙏🙏🙏
@ujwalapatil650
@ujwalapatil650 4 жыл бұрын
Thanks for giving valuable knowledge
@Mrbestvlog2012
@Mrbestvlog2012 2 жыл бұрын
Very much addictive videos and much better than paid platform
@SHASHANKRUSTAGII
@SHASHANKRUSTAGII 3 жыл бұрын
I dont you know, you guys noted the time , but i did, great improvement from 6 seconds to 5.1 seconds. :) @22:24
@tusharagarwal5306
@tusharagarwal5306 Ай бұрын
Point?
@codekiller3061
@codekiller3061 2 жыл бұрын
wow...thank u so mch bhaiya.....i jst love your content .....u r doing gr8...i am learning a lot from u❤❤
@MayurZinc
@MayurZinc 3 жыл бұрын
very underated channel. Please support him guys
@kshitijmishra2716
@kshitijmishra2716 3 жыл бұрын
i am addicted to your videos
@devenderkumar-pr6ig
@devenderkumar-pr6ig 3 жыл бұрын
best video for cp
@gigachadkartik
@gigachadkartik 3 жыл бұрын
Sir please also teach maps, sets and various STL types
@rishantkumar2408
@rishantkumar2408 3 жыл бұрын
everytime he says "aise hin naam diya hai aisa kuch khaas hai nahi" i am like ---Gajab (it makes me feel that yeah it is easy )
@Amansingh-il9rn
@Amansingh-il9rn 3 жыл бұрын
owesome method of teaching , bhaia keep it up , we always be with you in learning process.
@magnifyknowledge746
@magnifyknowledge746 3 жыл бұрын
luv bro i love you yaar great explanation . Fantastic video.
@ENGCS_chetanr
@ENGCS_chetanr 2 жыл бұрын
Sir ur awsome the explanation is on next level keeping giving us these type of knowledge Love u ❤️❤️❤️❤️
@sujitpatil8373
@sujitpatil8373 2 жыл бұрын
why did you not create the prefix sum array size (n+1) * (n+1) ? You said that you will be adding 1 horizontal and 1 vertical row to handle array index out of bounds cases?
@abhishek04204
@abhishek04204 3 жыл бұрын
After yesterday's cc lunchtime I saw this very helpful ❤️
@yashmishra3898
@yashmishra3898 3 жыл бұрын
at 21:47 i am not understanding why the prefix sum of(c,b-1) does not contain the point (a-1,d) and (a,b ) also ....i mean it will calculate sum of each element till that index
@iamluv
@iamluv 3 жыл бұрын
suppose a 2 d array 1 2 3 4 5 7 prefix sum array of this 2 d array is 1 3 6 5 12 22 (you can try calculating by. the formulae i discussed before) Assuming 1 based indexing, here (2,2) with values has sum (1,1),(1,2),(2,1),(2,2) = 1+ 2 + 4 + 5, it doesnt have 3 (1,3), so if 2,2 doesnt have 1,3 why would (c,b-1) will have (a-1,d) in 2 d prefix sum array a cell (i,j) is storing sum of all the squares lying in the rectangle formed by (1,1) and (i,j), hope this explains
@ahmmedabdullahsaquif559
@ahmmedabdullahsaquif559 2 жыл бұрын
Thank you Sir.. love your teaching way
@kunalkeshavsinghsahni6861
@kunalkeshavsinghsahni6861 9 ай бұрын
most of the questions in descriptions use hashmap more than pre computation. It would be great if you could upload some relevant pre comp problems there.
@yourbestie4138
@yourbestie4138 4 жыл бұрын
Bro I have doubt that is google does visit our college to hire for cloud engineer but after joining for it can we make a switch to SDE at google if yes how tough is it ...or is it best to join Morgan Stanley(on campus) as SDE compared to google cloud engineer
@vishalchaurasia3386
@vishalchaurasia3386 3 жыл бұрын
This is awesome!!!
@kbwsoikat
@kbwsoikat 2 жыл бұрын
I appreciate your effort!
@harshagarwal1218
@harshagarwal1218 3 жыл бұрын
Great Explanation🔥🔥
@souvik5560
@souvik5560 4 жыл бұрын
@Luv No praise is enough for this initiative. Just a small query :- pf[0] may contain some garbage value, which would get added to p[1]. so, should we initialize pf[ ] array with 0 ?
@iamluv
@iamluv 4 жыл бұрын
i had declared pf arrays globally, global array in c/c++ by default have all values as 0. if you would initialise locally then you would have to initialise whole array as zero as it will contain garbage but not in case of global arrays as i did.
@manikantasai6118
@manikantasai6118 3 жыл бұрын
Nice Teaching with great energy /...............bro
@Anshika.Agrawal
@Anshika.Agrawal 2 жыл бұрын
Very nice and easy explanation 👍🏻
@imran4935
@imran4935 9 ай бұрын
Bro you are so incredible 😭
@sujoyseal195
@sujoyseal195 3 жыл бұрын
Video kaafi achha lga .
@rudranshnemade6299
@rudranshnemade6299 Жыл бұрын
Best Video 🌈🌈🌈 Thank you 🌸
@saminisrak5506
@saminisrak5506 3 жыл бұрын
Very Helpful videos.. Thank you..
@merlin2012
@merlin2012 3 жыл бұрын
Awesome Explanation
@ankityadav-xd5ld
@ankityadav-xd5ld 4 жыл бұрын
Amazing lecture
@kiku_to_herself
@kiku_to_herself 3 жыл бұрын
Mashallah Bahut acha h
@MehedihasanRaj-cz8zv
@MehedihasanRaj-cz8zv 3 жыл бұрын
Brother, you are awesome. From Bangladesh
@jatinaggarwal2671
@jatinaggarwal2671 3 жыл бұрын
Nice Explanation bro! Thanks a lot.
@abhishekvishwakarma9045
@abhishekvishwakarma9045 4 жыл бұрын
Ek number🔥🔥
@ItsRavinderSinghh
@ItsRavinderSinghh 3 жыл бұрын
Awesome explaination
@RitikKumar-bk6pj
@RitikKumar-bk6pj 2 жыл бұрын
Muje toh bahut bhadiya lga bhaiya
@dhruvjain2209
@dhruvjain2209 3 жыл бұрын
damn ... very well explained .. Respect!!
@aradhyapandey1489
@aradhyapandey1489 3 жыл бұрын
very well explained, thank you bhaiya.
@dhritisingh9595
@dhritisingh9595 3 жыл бұрын
Really nice explanation
@yashmishra3898
@yashmishra3898 3 жыл бұрын
at 16:02 also sum till (2,3) will not contain elements like 2,4 and 2,5 or 1,4 and 1,5
@iamluv
@iamluv 3 жыл бұрын
that is exactly what i said in video
@rounakagarwal1600
@rounakagarwal1600 3 жыл бұрын
video was very good and thanks for giving practice question
@jay8389
@jay8389 3 жыл бұрын
Great explanation!!
@codeAsCoder
@codeAsCoder 3 жыл бұрын
😀 mast 💯💯💯
@abhishekmorla1
@abhishekmorla1 3 жыл бұрын
best
@elemento8763
@elemento8763 3 жыл бұрын
Awesome video, once again Sir, in fact today only, I came across a question based on Prefix Sum in 2D array, thanks a lot, Sir!
@govindsharma7696
@govindsharma7696 3 жыл бұрын
East or west Luv bhaiya is the best :) Lots of love amd respect for u bhaiya .
@almoontasirmoon933
@almoontasirmoon933 2 жыл бұрын
awesome tutorial bro
@pansgami8954
@pansgami8954 3 жыл бұрын
Nice Explanation bro...
@adarshdubey1784
@adarshdubey1784 3 жыл бұрын
U nailed it 🔥...bro make 1 video to find out time complexity of recursive Function ..I always face difficulty while finding time complexity of recursive Fun
@sahilchhabra2391
@sahilchhabra2391 3 жыл бұрын
Nicely explained sir
@vedantkulkarni9098
@vedantkulkarni9098 3 жыл бұрын
Can you please do or suggest a video on range query in 2D array like how you have done in 1d array where we had to add integer k from l to r in constant time
@arafathdhroba8897
@arafathdhroba8897 2 жыл бұрын
thank u very much sir!!
@kiku_to_herself
@kiku_to_herself 3 жыл бұрын
Good one Thanks sir
@lily5469
@lily5469 Жыл бұрын
Hi, Is there English version of your course?
@Learner010
@Learner010 3 жыл бұрын
very nice explanation
@GauravKumar-uu9lg
@GauravKumar-uu9lg 3 жыл бұрын
Bhaiya aap 1000 sal jiyo
@bibekanandanayak8839
@bibekanandanayak8839 4 жыл бұрын
I love you bro please keep it up
@sanketatmaram
@sanketatmaram 2 жыл бұрын
good explaination
@rahulkadam6655
@rahulkadam6655 3 жыл бұрын
Thanks a lot 💯
@mohan_792
@mohan_792 Жыл бұрын
at 9:42 On line 23, pf[i] = pf[i-1] + a[i-1]; hona chahiye na Nahi to array index out of range chala jaayega
@sit33darshanpagar16
@sit33darshanpagar16 3 жыл бұрын
Prefix sum array should be of long long type? 🤔🤔
Chain Game Strong ⛓️
00:21
Anwar Jibawi
Рет қаралды 41 МЛН
It’s all not real
00:15
V.A. show / Магика
Рет қаралды 20 МЛН
Stop using std::vector wrong
23:14
The Cherno
Рет қаралды 165 М.
you will never ask about pointers again after watching this video
8:03
The Doomsday Algorithm - Numberphile
14:33
Numberphile
Рет қаралды 857 М.
Prefix Sum Array and Range Sum Queries
7:30
Profound Academy
Рет қаралды 8 М.
Fast Inverse Square Root - A Quake III Algorithm
20:08
Nemean
Рет қаралды 5 МЛН
"Clean" Code, Horrible Performance
22:41
Molly Rocket
Рет қаралды 940 М.
Count Subarray sum Equals K | Brute - Better -Optimal
24:09
take U forward
Рет қаралды 372 М.
Prefix Sums and Difference Array: 20 minutes of EVERYTHING you need to know
20:00
Competitive Programming with Shayan
Рет қаралды 3,9 М.