8.4 Array Challenges | C++ Placement Course

  Рет қаралды 818,093

Apna College

Apna College

Күн бұрын

Link to the notes of this PDF : drive.google.c...

Пікірлер: 1 400
@saitejalucky6428
@saitejalucky6428 3 жыл бұрын
The concept of DryRun is very awesome ... That makes us to understand very easily.... Make all the prblms on the basis of Dry Run .. bhaiya...
@immortalliquido7812
@immortalliquido7812 3 жыл бұрын
Bohot sai likha dry run bohot acha tareeka hai
@Hidden..03
@Hidden..03 3 жыл бұрын
i m not able to understand the logic of using 2 of intialization please help..
@anuj8825
@anuj8825 3 жыл бұрын
@@Hidden..03 which initialization are you talking about? Be specific, please. if you're talking about int ans = 2; It means, IF we are not able to find even single AP in our array.. we'll always have a subarray of 2 elements, which has some common difference. WE WILL ALWAYS have at least 2 elements in our array, jiska difference kuchh toh hoga hi sahi, hence they can be considered as THE LONGEST CONTINUOUS SUBARRAY with some common difference.
@rameshmalhotra9525
@rameshmalhotra9525 2 жыл бұрын
kzbin.info/www/bejne/a3fWepRqgtVmntE
@rameshmalhotra9525
@rameshmalhotra9525 2 жыл бұрын
kzbin.info/www/bejne/a3fWepRqgtVmntE
@pranayprasad50
@pranayprasad50 3 жыл бұрын
I was really scared for google kickstart questions but after solving subarray question from kickstart all by myself I am relaxed now with more confidence thank you Apna college for this amazing course
@sharandeepakrb2219
@sharandeepakrb2219 3 жыл бұрын
Aman Bhaiya and Team, Please do try to give us the optimal solution for every problem and do mention the time complexity. Great work guys keep it up : )
@tanyacharanpahadi158
@tanyacharanpahadi158 3 жыл бұрын
finally, we are out of beginner level stuff
@coder4
@coder4 3 жыл бұрын
Ye sab beginners level ke the😱😱😱
@varunchoudhary8797
@varunchoudhary8797 3 жыл бұрын
@@chiranjeev331 pdai ki bat kiya Karo,sb aman bhai ki copy me lag gay🙄
@anirbanchakraborty5519
@anirbanchakraborty5519 3 жыл бұрын
@@varunchoudhary8797 ye sahi baat ki hai 😂
@videoyoutube3892
@videoyoutube3892 3 жыл бұрын
@@chiranjeev331 tu apna link spam karna bhand karega tu padega toh nhi ulta comment section ke real doubts ko disturb karta hai ye link apne pass rakh aur agli video mein maat aana i am serious .....
@rutvikrana512
@rutvikrana512 3 жыл бұрын
Yep from basic -> easy. Medium , hard and extreme are still in queue. 😂
@shreyaschavhan5522
@shreyaschavhan5522 3 жыл бұрын
Time Stamps - Q. 1] Max till i - [1:03] Example - [1:24] Approach - [2:00] Dry Run - [2:20] Code - [3:30] Subarray vs Subsequence - [5:18] Q. 2] Sum of all SubArrays - [8:04] Example - [8:25] Approach - [9:29] Dry Run - [10:10] Code - [11:21] Q. 3] Longest Arithmatic Subarray - [14:03] Approach - [20:28] Code - [22:25] Q. 4] Record Breaker - [25:30]
@neelsanghvi2817
@neelsanghvi2817 3 жыл бұрын
Kya sahi kaam karte ho tum, Shreyas bhai
@TAZER-ANUJRAWAT
@TAZER-ANUJRAWAT Жыл бұрын
kyu krte ho
@shreyankshrestha9274
@shreyankshrestha9274 3 жыл бұрын
this time this guy really improved its teaching skill.
@adityatrehan9838
@adityatrehan9838 3 жыл бұрын
aur bhaiya joke bhi mst maar re hain😂
@rajansingh1919
@rajansingh1919 3 жыл бұрын
tumse to jrur bhuuuuuuuuuuuuuut a6a pdhate hai
@kailashpatel231
@kailashpatel231 3 жыл бұрын
True,pichli baat bullet train ban gye the
@rameshmalhotra9525
@rameshmalhotra9525 2 жыл бұрын
kzbin.info/www/bejne/a3fWepRqgtVmntE
@sandippaul468
@sandippaul468 Ай бұрын
"its"
@devanshprataptiwari5804
@devanshprataptiwari5804 3 жыл бұрын
This is the first I am feeling confident in subarray problems. A BIG THANKS TO YOU SIR
@pavankumar-gp9zx
@pavankumar-gp9zx 3 жыл бұрын
20:30 intuition and approach 31:30 brute force approach
@srivathsgondi191
@srivathsgondi191 3 жыл бұрын
this video was more explainatory than the previous ones, especially when he explained the loop working.
@md.ualiurrahmanrahat2400
@md.ualiurrahmanrahat2400 3 жыл бұрын
what a video yaar!!! it made my day......Solved a google problem first time in my life......Salute to Apna College.........
@philosphize
@philosphize 3 жыл бұрын
I don't know how I can thanks to you and specially @Aman dhattarwal sir. I am watching him from very starting, each time I feel their content remains at top of my priority But this series is really record breaking as this was also including in problem. Thanks Aman dhattarwal sir for providing us such a great content and thanks to you sir for making such a great topic and problem in so easy way Love your team
@ytgamer2642
@ytgamer2642 3 жыл бұрын
we all appriciate for their hard work
@Radaradababurao
@Radaradababurao 3 жыл бұрын
For second question i.e(Record breaking day) For example :- INPUT 7 1 2 3 4 5 6 7 Answer comes for sometimes and sometimes it doesn't. It is depending on value inside array[n] element I think loop should be like int i; for(i=0;itill_max &&array[i]>array[i+1] ) { ans++; } till_max=max(till_max,array[i]); } //if i==n-1 if(array[i]>till_max) { ans++; }
@AmanKumar-nb4oh
@AmanKumar-nb4oh 2 жыл бұрын
I think u didn't read question clearly .Read once u get it
@GaneshPatil-vj1qp
@GaneshPatil-vj1qp 3 жыл бұрын
16.16 😂 please ki to jarurat hi nahi hai, hum to waise hi help kr dete hai 🙌
@adityatrehan9838
@adityatrehan9838 3 жыл бұрын
kuki ladkio ki hmesha help krni chahiye 😂
@search_Adam_seeker
@search_Adam_seeker 3 жыл бұрын
16:16
@RGmusics73
@RGmusics73 3 жыл бұрын
@Rahul mai comment ke reply mai yahoo likhne wala tha🤣
@MuhammadBurhan-b7c
@MuhammadBurhan-b7c Жыл бұрын
In Problem 1 (max till i) : The max() function from the library is used to update the mx variable inside the loop. The max() function returns the maximum of the two arguments provided. In each iteration of the loop, max(mx, arr[i]) is used to compare the current maximum mx with the current element arr[i], and the larger value is assigned back to mx.
@zeeldesai7043
@zeeldesai7043 Жыл бұрын
Exactly, how is it returning maximum for all till i?
@shreyanshmalviya4968
@shreyanshmalviya4968 3 жыл бұрын
3:37 In 1st problem the value of mx should be -2147483648 or you can also use INT_MIN in library as it is the minimum c++ integer number. Like if you agree.
@parthmahajan6535
@parthmahajan6535 2 жыл бұрын
i used that , and its actually more funtional imo
@adnanzahid1697
@adnanzahid1697 2 жыл бұрын
u can even initialise mx by arr[0].
@abhishekgarg4628
@abhishekgarg4628 2 жыл бұрын
exactly!
@rishitshah2602
@rishitshah2602 3 жыл бұрын
3-3=1 wow what a wonderful mathematics 🤩🤩🤩
@dontsubscribetomychannel8619
@dontsubscribetomychannel8619 3 жыл бұрын
Rishit Shah Insan hi toh hai, galtiyan ho jaati hai
@dontsubscribetomychannel8619
@dontsubscribetomychannel8619 3 жыл бұрын
Rishit Shah and you should try to improve your grammar and sentence structure
@QUACKKKKKKKK
@QUACKKKKKKKK Жыл бұрын
Wow what a wonderful grammar
@thearjunmishra
@thearjunmishra 11 ай бұрын
😂😂😂😂
@anushkakumari535
@anushkakumari535 10 ай бұрын
Bhai Maine dekha bhi nhi shayad tum yahi dekhne aaye the
@kritisharma8678
@kritisharma8678 2 жыл бұрын
Im glad aman sir exist, from being motivated enough and securing 96% in 10th boards, 95% in 12th boards and watching this playlist in my 1st sem I never needed to take coachings and tutions, Thank you sir
@COSMICUNVEILNOW
@COSMICUNVEILNOW 8 ай бұрын
Apna college literally saving my CS degree
@teamamroninja333
@teamamroninja333 5 ай бұрын
laggi naukri ya placement????
@COSMICUNVEILNOW
@COSMICUNVEILNOW 4 ай бұрын
@@teamamroninja333 Yups.
@tamal_sen
@tamal_sen 3 жыл бұрын
For kick-start challenge no-1. As per constraint, 0
@पापीगुडिया-ह3ढ
@पापीगुडिया-ह3ढ 2 жыл бұрын
Long int se kya hoga
@vamshi1918
@vamshi1918 2 жыл бұрын
@@पापीगुडिया-ह3ढ Range of numbers is larger in long int
@पापीगुडिया-ह3ढ
@पापीगुडिया-ह3ढ 2 жыл бұрын
@@vamshi1918 kitni long ha vro
@jinisha6485
@jinisha6485 3 жыл бұрын
At 12:58, See carefully, The testcase failed. You will actually require 3 loops, not 2. Here is the code for printing the sum of all subarrays: #include using namespace std; int main(){ int n; cin>>n; int arr[n]; for(int i = 0; i < n; i++) cin>>arr[i]; int sum = 0; for(int i = 0; i < n; i++) { for (int j = i; j < n; j++) { for (int k = i; k
@sarfarazstark
@sarfarazstark 2 жыл бұрын
yeah, you are right
@_k_vin_p
@_k_vin_p 2 жыл бұрын
three nested for loops will increase time complexity O(N3), if you see the solution in video it gives sum of each sub arrays differently so we can make another variable and add all the subarray sums in it with O(n2)
@mayurknair
@mayurknair 2 жыл бұрын
you can do this but the time complexity will be proportional to n^3 which is not quite favourable
@sujayh1595
@sujayh1595 Жыл бұрын
try this #include using namespace std; int main() { int n; cin >> n; int arr[n]; int sum=0; for (int i = 0; i < n; i++) { cin >> arr[i]; } for (int i = 0; i < n; i++) { int curr=0; for (int j = i; j < n; j++) { curr+=arr[j]; sum+=curr; } } cout
@BharathKumar-pd9qs
@BharathKumar-pd9qs Жыл бұрын
It will bcoz you have not given any expected output in the blank
@FireGamingPro
@FireGamingPro 2 ай бұрын
O(n) solution for subarray question: int sm=0; for (int i=0;i
@itshiraljain
@itshiraljain 3 жыл бұрын
Thank you Aman Bhaiya and the whole team for everything. You guys are amazingly insane, hardworking!!!!!!!!!!
@durgashreenvshreenv1422
@durgashreenvshreenv1422 Жыл бұрын
The idea of explaining the approach is just amazing, it made things so clear!
@ayushchauhan6676
@ayushchauhan6676 3 жыл бұрын
15:15 since when 3 -3 becomes one .. it literally took me a minute to understand that whether i am listening it wrong.
@amritrijal6967
@amritrijal6967 3 жыл бұрын
i didn't understood.
@587_mehulrana2
@587_mehulrana2 3 жыл бұрын
he meant 3-3 = 0 , 3-3=0 ,galti se idhar udhar nikal gaye bhaiya
@ansitakumari5532
@ansitakumari5532 3 жыл бұрын
Same here 😂😂😂
@dixitbothra1481
@dixitbothra1481 2 жыл бұрын
sir, in the longest arithmetic subarray question there should be while(j
@kumkumslab5811
@kumkumslab5811 2 жыл бұрын
bro indexing starting from 0 btw whts u studying
@mydreamvlog_MDV
@mydreamvlog_MDV 3 жыл бұрын
I loved the way the faculty has taught everything is crystal clear really even difficult question has been explain in simplest way.👏👊 Thanks alot for these lecture
@Hidden..03
@Hidden..03 3 жыл бұрын
i m not able to understand the logic of using 2 of intialization please help..
@aryansinha1818
@aryansinha1818 3 жыл бұрын
Apna College : Constraints are important Me Before : *Yeh sab kya faltu cheez de rakhi hai , isse kuch nahi hota. Lol*
@Sahil-ev5ms
@Sahil-ev5ms 3 жыл бұрын
Shi bola bhai😂
@amitanandanojha3419
@amitanandanojha3419 3 жыл бұрын
😂😂hmm same
@onkarnagarkar4693
@onkarnagarkar4693 3 жыл бұрын
I have a simpler solution which does not use the concept of subarray but has a time complexity of n+n. The solution in video has nested for loops thus higher time complexity. In my solution I have created a new array diff_arr[] which stores the differences of the consecutive elements of the test/input array. So as in the video example : test array: 10 7 4 6 8 10 11 (n=7, denoted by arr[] in the solution below) diff array: -3 -3 2 2 2 1 (n=6 , denoted by diff_arr[] in the solution below) Then I just counted the similar elements of diff_arr[] and stored it in max to find the maximum occurrence. I initialized the count to zero, every time the similar element chain broke(or the similar element set ended) so that I can count the next set of similar elements in the diff_arr[]. using max function, I found out the maximum count which the expected ans. Note: the similar elements in diff_arr[] mean the difference of consecutive elements is same in the test array. 1st Solution: Here is the function: void longest(int arr[], int n) { int arr_diff[n-1]; for(int i=0; i
@shashankrana1807
@shashankrana1807 2 жыл бұрын
yes it is better soln. I feel
@aegg792
@aegg792 Жыл бұрын
The solution shown in video was O(n) only, it didn't have nested loops.
@priyanshuagrawal9204
@priyanshuagrawal9204 Жыл бұрын
in the last question, you also need to check that I!= n-1 , else you will get runtime error, when the compiler will check a[n] and will not find that elem
@vaibhavchaubey8373
@vaibhavchaubey8373 3 жыл бұрын
The concept of DryRun is very awesome👍👍
@shiveshanand5812
@shiveshanand5812 2 жыл бұрын
In the 1st question, instead of initialing mx to minimum value of integer, we can initialize it with a[0].
@ritikingle3188
@ritikingle3188 3 жыл бұрын
in problem No 1 we also can use INT_MIN insted of small value.
@SukhmanSinghSandhu
@SukhmanSinghSandhu 2 жыл бұрын
Yes
@shabankhan4383
@shabankhan4383 3 жыл бұрын
on first question, my approach was this (after taking elements from user) . . for(int i=0;i
@prankushsharma2588
@prankushsharma2588 3 жыл бұрын
kya energy ke sath teach kiya and samagh bhi ussi energy ke sath aaya😁😁😁😎😎✌👌
@mitulsheth9323
@mitulsheth9323 2 жыл бұрын
My man just broke all records, surpassed Ramanujan and Newton right here 15:12
@siddharthkeshri5649
@siddharthkeshri5649 3 жыл бұрын
19:52 bhai ka confidence 🔥🔥😂
@iampatelajeet
@iampatelajeet 3 жыл бұрын
Value of mx can be initialized by first element of the array and start iterating by 2nd element.
@hitaanshshah8228
@hitaanshshah8228 2 жыл бұрын
yes implemented the same
@TrainWithShubham
@TrainWithShubham 3 жыл бұрын
This video is so beautifully made, it made me stick throughout. Good teaching with explanation
@TrainWithShubham
@TrainWithShubham 3 жыл бұрын
@Xyz z kamaaal
@TrainWithShubham
@TrainWithShubham 3 жыл бұрын
@Xyz z bhai sahi bol rahe ho (3-3)=1 hone laga.. but good series.. like it
@TrainWithShubham
@TrainWithShubham 3 жыл бұрын
@Xyz z 😂😂😂
@rameshmalhotra9525
@rameshmalhotra9525 2 жыл бұрын
kzbin.info/www/bejne/a3fWepRqgtVmntE
@swapnilshinde2540
@swapnilshinde2540 3 жыл бұрын
11:33 the question is find sum of all sub arrays but 13:47 your output is totally different , after every iteration of I its refreshing its value
@jiosim1377
@jiosim1377 3 жыл бұрын
Yea it should after finding sum of one subarray the sum should become 0 again
@deepurana6010
@deepurana6010 3 жыл бұрын
Yes u r right bro,👍
@syedumar9306
@syedumar9306 3 жыл бұрын
Yes, I am also struggling on this from the last 90mins. Aur yeh chutiye chamche jinko kuch samjh nhi aata, likh rhe hai I love u bhaiyya, very nice bhaiyya, aur bhaiyya inko chutiya bana rhe hai galat solutions upload krke
@swapnilshinde2540
@swapnilshinde2540 3 жыл бұрын
@@syedumar9306 ya but after array all solution of ds are correct and well explained. May be because of recruting new people into teaching.
@ayushmahawar6539
@ayushmahawar6539 3 жыл бұрын
i think first ques can be done by this also by taking first element of array as mx int n ; cin>>n; int arr[n]; for(int i = 0 ; i < n; i++){ cin>>arr[i]; } int mx = arr[0]; for(int i = 1 ; i
@RavinderSingh-jt7kd
@RavinderSingh-jt7kd Жыл бұрын
this is better
@Aravik02
@Aravik02 Жыл бұрын
Yes and in the video he did a mistake by not taking mx =arr[i];
@shreyanshmalviya4968
@shreyanshmalviya4968 3 жыл бұрын
better and small code for the last question.--> #include #include using namespace std; int main() { int n; cin>>n; int a[n]; int count=0; int max=INT_MIN; for(int i=0;i>a[i]; } for(int i=0;imax&&a[i+1]
@shreyanshmalviya4968
@shreyanshmalviya4968 3 жыл бұрын
@@harshdasila6680 No Harsh, I checked the code again with your test case and the answer is still correct (3) .
@shreyanshmalviya4968
@shreyanshmalviya4968 3 жыл бұрын
@@harshdasila6680 That's not a problem because when the statement is false then it is not the greatest element and int max is not updated.
@mdafridi7940
@mdafridi7940 3 жыл бұрын
slightly wrong code. because there is no rule for last day. check for test case 4 8 15 16 23 42 the output should be 1.
@mdafridi7940
@mdafridi7940 3 жыл бұрын
This is the modification in the main loop for(int i=0;imax && ((a[i]>a[i+1]) || i==n-1 )) { count++; max=a[i]; } }
@shreyanshmalviya4968
@shreyanshmalviya4968 3 жыл бұрын
@@mdafridi7940 Thanks for the correction and instead we can also use a[n]=0; using the old if condition like: a[n]=0; for(int i=0;imax&&a[i+1]
@nitindeadpool
@nitindeadpool 3 жыл бұрын
If U are watching it 8 months later, it's not late yet to start with a BANG!! 🌚
@codetogether24x7
@codetogether24x7 3 жыл бұрын
In longest arithmatic subarray question: we can also make an array which will store the difference of consecutive elements.After that we can simply calculate the number which repeats maxium time and lets say that we store this ans in varible max. After getting max value just increase by 1 and print it.. correct me if i am wrong.
@DhananjayKumar-oz7ss
@DhananjayKumar-oz7ss 2 жыл бұрын
but you can't say it will be contigious.
@aniketmani7502
@aniketmani7502 2 жыл бұрын
yeah, you can, We always try to remove nested loops, but we should also reduce too many loops
@Sonia-o6y
@Sonia-o6y 6 ай бұрын
But then space complexity will be more..one additional array would be needed to store the differences ..
@darshanrevgade7819
@darshanrevgade7819 3 жыл бұрын
Did anyone Noticed there is No Add in these Vedios. Hats off to you Aman Bhaiya Thank you😃
@upamadutta5741
@upamadutta5741 3 жыл бұрын
ismai thanks maat bolo yaar, ads kitne time ke ate h?? bht jyada ho to 1-2minutes, hamare kuch vi problems nhi hote us time mai, but Aman sir ko huch help ho jata j, ads ani chahiye,
@darshanrevgade7819
@darshanrevgade7819 3 жыл бұрын
@@upamadutta5741 see here, I want to tell How big his Heart is! It will be Ok to place adds.
@abhishekupadhyay8016
@abhishekupadhyay8016 2 жыл бұрын
since, we are comparing within the array. so, we can take max=arr[0]; and update by comparing with remaining element in an array
@abhishekupadhyay8016
@abhishekupadhyay8016 2 жыл бұрын
what are your suggestions❓❓
@ashisharyan3028
@ashisharyan3028 3 жыл бұрын
now its going bang....I am going to be fully depend on this for my c++ course
@rajansingh1919
@rajansingh1919 3 жыл бұрын
gjb bhaiya.... ek nm pdhaye haii... sb se best ki aap isme dry and run krwa ke code smjhaye haii wo ek n. lgaaa..lalntop
@immortalliquido7812
@immortalliquido7812 3 жыл бұрын
We can also use INT_MIN in climits directory instead of -19999999?
@devastrator25902
@devastrator25902 3 жыл бұрын
yes, you absolutely can
@immortalliquido7812
@immortalliquido7812 3 жыл бұрын
I had a doubt jn last question why do we take a[j+1]? Instead of a[j]? Please tell (explain please).
@mulakalachaitanya
@mulakalachaitanya 3 жыл бұрын
@@immortalliquido7812 I think you meant why a[n+1] instead of a[n]. It's because for the last element you can't check whether it is greater than the next element So he created an array of size (n+1) and initialized last element with -1.
@harshitasinha2590
@harshitasinha2590 3 жыл бұрын
Actually dono correct h
@harshitasinha2590
@harshitasinha2590 3 жыл бұрын
Kyuki int ka range utna hi hota h so int ka minimum number wahi hoga
@anuragvermav6008
@anuragvermav6008 2 жыл бұрын
Questions Q1 6:00 max till i Important about array { 5:30 subarrays 6:30 subsequence } Q2 8:10 sum of all subarrays Q3 14:05 longest arithematic subarray question by google kickstart Q4 25:33 record breaker question by google kickstart
@escprel101
@escprel101 3 жыл бұрын
Really loved your charisma while teaching
@ayushdebnath3343
@ayushdebnath3343 3 жыл бұрын
Ye video overdose hogaya Lekin maja bohot aaya questions bohot challenging the thanku u APNA team for your hardwork
@Ravikumar-dw1lg
@Ravikumar-dw1lg 3 жыл бұрын
If anyone is not able to understand this concept, watch once again,you definitely understand everything👍
@manishpatil6726
@manishpatil6726 3 жыл бұрын
Ya I didn't get it bro
@blackenova3
@blackenova3 Жыл бұрын
would u help me with this? 32:25 how?
@UmeshKumar-qw9op
@UmeshKumar-qw9op 3 жыл бұрын
Sir us point per to maja hi aa gya jab aapane ne bola ki sub array batana to ek bahana tha ham apako eh sikhana chahte the ki sub array se khela kaise jata hai
@bapanghosh166
@bapanghosh166 3 жыл бұрын
You can use this method also for the "longest subarray" : void subArray(int a[], int n) { int count =2; int mx=2; int pd=a[1]-a[0]; for(int i=1 ; i
@RahulKumar-xl3dd
@RahulKumar-xl3dd 2 жыл бұрын
​ Why are we starting our array from a[n+1] and than initializing it with -1 ???
@techrohit6228
@techrohit6228 2 жыл бұрын
Can u explain why u write int count= 2 and int max= 2
@suryaprakash1890
@suryaprakash1890 2 жыл бұрын
@@techrohit6228Bcz of atleast one subarray of size 2 exists with greatest sum .example: 1 3 6 8 1 .output->2. 8 1 subarray with highest sum
@reallygoodstuff4441
@reallygoodstuff4441 3 жыл бұрын
1 ki baat is bande ka video muze samaj aya good work dude 😀
@kunalmahajan5135
@kunalmahajan5135 3 жыл бұрын
In the last problem sir by mistake wrote a[n]=-1 instead of a[n+1]=-1 . so that a[n] is always greater than a[n+1] for 2nd condition optimization. Just check.
@vinaysinghania4447
@vinaysinghania4447 2 жыл бұрын
awesome teacher best line "ye nayi baat bta di tumne " 🤣🤣🤣🤣🤣😛😋
@pritishpattnaik4674
@pritishpattnaik4674 3 жыл бұрын
we want more questions like this
@parthparmar9798
@parthparmar9798 3 жыл бұрын
36:19 Instead of taking array of n+1 you can use a logical operator && in checking the first condition then it will be if(a[i]>mx && i>0)
@mdmuizzrafid
@mdmuizzrafid 2 жыл бұрын
I Couldn't understand why to take n+1 in array and then declare n=-1.. Please if can explain explicitly may a great help...
@parthparmar9798
@parthparmar9798 2 жыл бұрын
@@mdmuizzrafid for not to handle extra case for last element.
@garvitgoyal5236
@garvitgoyal5236 2 жыл бұрын
hey, the work you have done is awesome but as a beginner i faced so much difficulty in understanding concepts from this video, i didnt even understood test case concept.
@sagarjain4128
@sagarjain4128 2 жыл бұрын
Me too
@yashsaraswat2890
@yashsaraswat2890 2 жыл бұрын
same here
@rameshmalhotra9525
@rameshmalhotra9525 2 жыл бұрын
kzbin.info/www/bejne/a3fWepRqgtVmntE
@chsanro
@chsanro 2 жыл бұрын
Me neither
@theknowledge3365
@theknowledge3365 2 жыл бұрын
@@sagarjain4128 it's been 9 months since u commented so i suppose u must be understanding it now.... how did u do it....
@LifewRoshu
@LifewRoshu 2 жыл бұрын
Thank you so much AMAN BHAIYA and the whole team of APNA COLLEGE ❤️❤️✨✨
@niteshchaudhary4724
@niteshchaudhary4724 3 жыл бұрын
I think the last solution for the record-breaking day can be optimized to root(n) if we skip the very next element to the current element. Correct me if I wrong.
@siddharthchaturvedi8383
@siddharthchaturvedi8383 3 жыл бұрын
Bestest video ever... do like the video for his growth thanks alot...
@kumarharsh90
@kumarharsh90 3 жыл бұрын
Really really better from last one I loved it
@thelandofdevil8593
@thelandofdevil8593 3 жыл бұрын
solution for problem 1 with time complexity of O(n) #include using namespace std; int main(){ int n; cin>>n; int arr[n]; // taking input of array elements----- cin>>arr[0]; int max=arr[0]; for(int i=1;i>arr[i]; if(max
@priyanshabhasin7414
@priyanshabhasin7414 3 жыл бұрын
Best educational content on You Tube..you guys are doing great job👍
@stocks4Trading
@stocks4Trading 3 жыл бұрын
"SUBARRAY TOH EK BAHANA THA... AAPKO SUBARRAYS KEH SAAT KAISE KHELTE HAI WO SIKHANA THA"-------GREAT SIR --------------------------------- LOVE YOU SIR
@ayushibisht3896
@ayushibisht3896 3 жыл бұрын
really grateful for all you guys are doing for students
@DineshSharma-pp3ox
@DineshSharma-pp3ox 3 жыл бұрын
This Course is god father of all premium courses
@asthajain7207
@asthajain7207 2 жыл бұрын
Bhaiya,the concept of kick start was hard for the beginners like us please make it more easy to learn
@P-M.
@P-M. 3 жыл бұрын
Coding to apake liye compassion hai , shayri he apka asli passion.
@shlokhinge3179
@shlokhinge3179 3 жыл бұрын
Bhaiya on thumbnail it's written 9.1 part and In video description it's written 8.4 part... Please correct it so that future viewrs may not get confused ☺️
@sahilpatil37
@sahilpatil37 3 жыл бұрын
Absolutely right 😊
@vishalprajapati1208
@vishalprajapati1208 3 жыл бұрын
Ye sab bate 6odo or padhai pe dhyan do 🤦🤦
@shlokhinge3179
@shlokhinge3179 3 жыл бұрын
@@vishalprajapati1208 ha bhai...😅 Par fir bhi kisiko problem nahi ani chahiye iisliye... By the way I am fresher😀
@suryaprakash1890
@suryaprakash1890 2 жыл бұрын
Longest arthimatic array problem: Input : 2 4 6 8 10 output:4 But output should be :5 To obtain correct output j should be initiated as j=1
@asgardianbond4572
@asgardianbond4572 2 жыл бұрын
EXactly, I was also wondering why no 1 had commented on this....
@ajinkyakale3353
@ajinkyakale3353 3 жыл бұрын
A much simpler code with lesser time complexity for the 'Record-Breaking Day' question: #include #include #include using namespace std; int main() { int arr[10]; cout > arr[i]; } int mx=arr[0]; int RecBr; int counter=1; for (int i = 0; i < 5; i++) { mx=max(arr[i],mx); if((mx== arr[4] || arr[i]>arr[counter]) && arr[i]>=mx ){ RecBr=counter; cout
@adabmann7586
@adabmann7586 2 жыл бұрын
how's this?? int recordbreaking(int arr[], int n){ int curr=INT_MIN; int count = 0; bool value = true; for(int i = 0; i curr){ if(i==n-1){ count += 1; } value = true; curr = arr[i]; continue; } else if (arr[i] < curr && value){ value = false; count += 1; } } return count; }
@ASMR-bu8qc
@ASMR-bu8qc 2 жыл бұрын
FYI...we can initialize mx to INT_MIN and add climit to headers.
@ankitkumarojha7510
@ankitkumarojha7510 Жыл бұрын
brilliant but if u go line by line together with question & code then that will be very nice...for competitive programming
@swarnadeepdeb7521
@swarnadeepdeb7521 3 жыл бұрын
Bhai problem ka jo quality ha na bohot gajab ka da rakhe ho 🔥🔥
@snehilsinha4689
@snehilsinha4689 3 жыл бұрын
First Urvi Goel didi, now Rishabh Gupta bhaiya... Who's next 🤔🤨? 😁😁
@hudaaa_
@hudaaa_ 3 жыл бұрын
How do u know the names
@kunalpathak1862
@kunalpathak1862 3 жыл бұрын
@@hudaaa_ sahi se video dekhi ho to pta hota
@sandeepkumarsingh4802
@sandeepkumarsingh4802 3 жыл бұрын
total 5 hai
@snehilsinha4689
@snehilsinha4689 3 жыл бұрын
@@hudaaa_ I am an Astrologer, I know everyone's kundali 🤣🤣😎😁.
@snehilsinha4689
@snehilsinha4689 3 жыл бұрын
@@sandeepkumarsingh48028 hai bro 5 phle the ab team bari ho gayi hai. Google, Amazon, Microsoft, Goldman Sachs, Gsoc, Arcesium in sab se bande hain team me 😍😎😁.
@ManishYadav-lg2qr
@ManishYadav-lg2qr 3 жыл бұрын
Rishabh Gupta bhaiya mast padhate ho yaar aap. Really appreciated man
@dontsubscribetomychannel8619
@dontsubscribetomychannel8619 3 жыл бұрын
Wow it has gotten difficult, Lagta hai ki ab serious hona padega
@agnivashil4130
@agnivashil4130 3 жыл бұрын
first time solved google kickstart questions!!!
@Rohitkumar-hj3wq
@Rohitkumar-hj3wq 3 жыл бұрын
one of the best explanation of code I have ever seen. Thank you❤
@ShubhamKumar-km8pm
@ShubhamKumar-km8pm Жыл бұрын
Thanks bhaiya i was able to solve the "max till i" and "record breaker" sum by myself.
@PankajSharma-vo9wr
@PankajSharma-vo9wr 3 жыл бұрын
Amazing ... Hats off to all the faculty who is working so hard for us, a special thanks to Aman bhaiya , huge respect.
@chiranjeev331
@chiranjeev331 3 жыл бұрын
Aman bhaiya doing prank kzbin.infoIwTpJ8YRsUg ........
@prajwalkumar8032
@prajwalkumar8032 3 жыл бұрын
Main mx ki value -199999999 nhi leta.. main mx ki value array input hone ke baad pehla element (a[0]). Aur phir waha se update krna chalu krta.. .. Agar -1999999 se chhoti value input krdi gyi to ye code galat output krde ga...
@aku_11_11
@aku_11_11 3 жыл бұрын
best tut currently watching on whole internet sir. u r very very awesome. urivi di is also very very awesome. many many best wishes and many many love to whole team.
@iamshark369
@iamshark369 Жыл бұрын
In the 2nd Example of the subarray, the current will go out from two for loops.
@s.k.g5544
@s.k.g5544 3 жыл бұрын
16:16 samjh rahe ho , samjh rahe ho aap☝
@Aryankumar-hm8qw
@Aryankumar-hm8qw 3 жыл бұрын
kya hi vdo h bhaiya mza aa ra h coding m ⚡... a tip don't code at the same time while watching the vdo you will not ne able to focus on vdo properly first watch it thn practice ..i was doing the same mistake ... thought it might help someone 💕
@Mayankkumar-hq6is
@Mayankkumar-hq6is 3 жыл бұрын
15:13 = 3-3=1 and 3-3 =1.....! galat pdhne mein jo maza hai wo kisi aur chiz mein nhi hai...!😆
@pradeepdotiyal1015
@pradeepdotiyal1015 3 жыл бұрын
sir apne jo sanskrit ka gyaan diya na ksm se mzza hi aa gaya
@milindjadhav5416
@milindjadhav5416 3 жыл бұрын
great work! Respect++ but the record-breaking problem can be more simplified in the following way : please like so that others can also see! //Program to find record-breaking day in an array(Google kickstart). #include using namespace std; int main() { int Length; cout
@mrunaligadekar4337
@mrunaligadekar4337 2 жыл бұрын
Where are u checking if ans greater than all previous elements?
@YashGautam-ik8si
@YashGautam-ik8si Жыл бұрын
🤪🤪 #include using namespace std; int main(int argc, char const *argv[]) { int n; coutn; int arr[n]; for (int i = 0; i < n; i++) { cin>>arr[i]; } int mx = arr[0]; int ans = 0; for (int i = 1; i < n; i++) { if (arr[i]>mx) { ans+=1; mx=max(mx, arr[i]); } } cout
@rajansingh1919
@rajansingh1919 3 жыл бұрын
Subarray ek bahana tha.... aap Subarray ke sath kaise khelte hai ye mujhe sikhana thaa 👌👌👌
@vipinbeni9367
@vipinbeni9367 3 жыл бұрын
Watched it 5 time to understand, but when I did understood it felt so good💫😇
@soumya7051
@soumya7051 3 жыл бұрын
which question?
@vipinbeni9367
@vipinbeni9367 3 жыл бұрын
@@soumya7051 Last Question
@0981abhishek
@0981abhishek 3 жыл бұрын
bhaiya you did a mistake, after curr += a[ j ] you also need to store the total sum by doing sum +=curr; and cout
@sahil1053
@sahil1053 3 жыл бұрын
variable name doesn't matter that much
@samarthkalshetti5008
@samarthkalshetti5008 3 жыл бұрын
30:27 that 'bulkul nalla hai ye' 😂 😂
@sayansadhukhan9692
@sayansadhukhan9692 3 жыл бұрын
Awwwwsomeeee video, keep posting complex problems with solutions like this
@sayansadhukhan9692
@sayansadhukhan9692 3 жыл бұрын
@Xyz z 3-3=1 obviously ye mistake hai, but arithmetic array ka matlab to samajh aya na bhaiiiii....ki consecutive elements ka difference same hoga.
@HarshGupta-wi1zn
@HarshGupta-wi1zn 3 жыл бұрын
7:48 kahawat is awesome 😂😂
@agnivashil4130
@agnivashil4130 3 жыл бұрын
:)
@chiranjeevi_tirunagari
@chiranjeevi_tirunagari 3 жыл бұрын
For Recordbreaker question: #include using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); int n; cin >> n; int arr[n]; for (int i = 0; i < n; i++) { cin >> arr[i]; } int prev_max = INT_MIN; int record_days = 0; for (int i = 0; i < n; i++) { if (arr[i] > prev_max && (arr[i] > arr[i + 1] || i == n - 1)) { record_days++; } prev_max = max(prev_max, arr[i]); } cout
@MangoLassiYT
@MangoLassiYT 2 жыл бұрын
how to add testcase loop in program
@krishnanand_yadav
@krishnanand_yadav 2 жыл бұрын
Slight mistakes, otherwise the video was awesome! In Subsequence definition, instead of "selecting zero or more...", it should be "removing zero or more...". Also, no. of subsequences = 2^n - 1.
@mayankdevnani894
@mayankdevnani894 2 жыл бұрын
Who told you that number of subsequences is 2^n -1 ?
@aniketmani7502
@aniketmani7502 2 жыл бұрын
total subsequences would be 2^n
@kalpeshkumawat6571
@kalpeshkumawat6571 2 жыл бұрын
2^n - 1 is the total number of non-empty subsequences while the total number of subsequences is 2^n
@white_wolf9413
@white_wolf9413 2 жыл бұрын
For the first problem we can also do this : int q1(int n,int a[]){ int max = a[0]; for(int i=1;i
8.5 Arrays - Q's asked by Top MNC's | C++ Placement Course
23:51
Apna College
Рет қаралды 587 М.
The Joker wanted to stand at the front, but unexpectedly was beaten up by Officer Rabbit
00:12
Girl, dig gently, or it will leak out soon.#funny #cute #comedy
00:17
Funny daughter's daily life
Рет қаралды 51 МЛН
DSA & ₹1.2 Crore Per Annum Jobs - The Truth? (No Offence)
12:22
CodeWithHarry
Рет қаралды 647 М.
Introduction to Arrays in C++ | C++ Tutorials for Beginners #lec42
23:36
Jenny's Lectures CS IT
Рет қаралды 28 М.
Object Oriented Programming (OOP) in C++ Course
1:30:26
freeCodeCamp.org
Рет қаралды 2,5 МЛН
8.1 Introduction to Arrays in C++ | Guaranteed Placement Course
12:32
Apna College
Рет қаралды 1 МЛН
Logic Building in Programming - 5 Proven Strategies (2024) 🔥
13:01
CodeWithHarry
Рет қаралды 412 М.
Arrays in C++ Programming (Urdu/Hindi)
27:23
IT Series
Рет қаралды 83 М.
The Joker wanted to stand at the front, but unexpectedly was beaten up by Officer Rabbit
00:12