bhaiya your debugging process in blackboard is making you diffrent then others keep it up BestOluck
@HONESTLYALOK Жыл бұрын
Thank you bhaiya
@VivekMishra-yq5us Жыл бұрын
❤❤
@Updatedknowledge9 Жыл бұрын
Bhaiya aap ek baat universal truth hai, ki starting me sab easy lagta hai, fir hard iske baaad, fir se sab easy lagne lagta hai ☺☺☺❤❤❤, main to aise hi feel kar rha hu,
@inspirationalyouthicons4998 Жыл бұрын
1:15:03 hw maximum diffrence between two elements:- int maximumdiffrencebetweentwoelements(int arr[],int n){ int suffix[n]; suffix[n-1] = arr[n-1]; for(int i=n-2;i>=0;i--){ suffix[i] = max(suffix[i+1],arr[i]); } int ans = INT_MIN; for(int i=0;i
@Anjali-ty2fk2 ай бұрын
Aap ek baar iss solution main mistake bta do please int suffix=nums[n-1]; int ans=INT_MIN; for(int i =N-2;i>=0;i--) { suffix=max(nums[i],suffix); ans=max(ans,suffix-nums[i]); } return ans; } return -1;
@ronitapatraАй бұрын
@@Anjali-ty2fk first you have to calcualte the difference then update suffix...otherwise suffix = nums[n-1] will update first...
@ujjwalgaur546016 күн бұрын
@@Anjali-ty2fk dont know this method i solved through two pointers mthd#include using namespace std; int main() { int arr[8] = {9, 8, 8, 12, 0, 3, 7, 4}; int s = 0, e = 1; // Start and end pointers int maxdiff = 0; // To store the maximum difference int n = 8; // Size of the array while (e < n) { if (arr[e] > arr[s]) { // Calculate the difference int diff = arr[e] - arr[s]; // Update maxdiff if the current difference is greater if (diff > maxdiff) { maxdiff = diff; } } else { // Move the start pointer to the current end pointer s = e; } // Always move the end pointer forward e++; } cout
@Sajal_Mallick_vlogs10 ай бұрын
Day 39/180 done and dusted.... Awesome explanation and exceptional learning.. Thank you bhaiya... #consistency
@imavinashsingh10 ай бұрын
0:00:01 [Prefix and Suffix Sum] 0:09:50 [Divide Array in two Sub arrays with equal sum ] 0:28:15 [Code Part] 0:35:15 [Largest Sum Contiguous Sub array] 0:47:40 [Kadane's Algorithm ] 1:01:15 [Code Part] 1:03:08 [Max. Difference b/w 2 elements]
@TheSilentObserver30 Жыл бұрын
Day 39/180..Growing strong each day and learning new everyday. You are making us consistent and confident. Thank you.
To print all subarrays: #include using namespace std; int main(){ int n; cin>>n; int arr[n]; for(int i=0; i> arr[i]; for(int i=0; i
@xavdok20 күн бұрын
I run your code and I did not get the ans, your code is wrong.
@maroofgpm Жыл бұрын
5:08 Likh Diya!! // Homework: Sum of suffix #include #include using namespace std; int main() { int vect[] = {1,2,3,4,5}; int n = 5; for (auto i : vect) { cout
At 48:45 when you add 7 and -5 it is 2 but don't replace it with maxi as maxi contains 7.
@mohdshabaz9675 Жыл бұрын
Good explanation of previous videos
@CoderArmy9 Жыл бұрын
Good morning bhai❤
@rockrock350 Жыл бұрын
never saw this much of dedication
@ajaythedaredevil72205 ай бұрын
Print all Subarray in an array: for i in range(len(res)): for j in range(i+1,len(res)): print(res[i:j])
@PotatoPcGamer016 ай бұрын
1:15:03 - Find Largest Difference between 2 elements (HOMEWORK) Time Complexity - O(N) Code : int largestDiff(vector& v, int index) { // 1) initialization : int size = v.size()-1; int difference = 0, ans=INT_MIN, findMax=INT_MIN; // 2) handling edge cases : if(index size) return -1; // 3) find max difference : for(int i = size; i>=index; i--){ findMax = max(findMax, v[i]); difference = findMax - v[i]; ans = max(ans, difference); } return ans; } PS - Suggestions / Replies are welcomed :)
@joydeep-halder Жыл бұрын
9:32 H/W Solution: Print all subarrays: for (int size = 1; size
@joydeep-halder Жыл бұрын
@@ddoy7378bhai compiler me run karke dekho.
@arjungurjar77027 күн бұрын
1:14:30 int maxDifference(int arr[],int n){ int ans = INT_MIN ; int suffix = 0 ; for(int i = n-1 ; i >=0 ; i--){ suffix = max(suffix , arr[i]); ans = suffix - arr[i]; cout
@RohitCoder11 ай бұрын
at 32:17 why dont we used for(int i=0; i
@bee.eee.5 ай бұрын
n-1 refers to the last element If we take i
@atifmalik80123 ай бұрын
59:29 //Kadane's algorithm class Solution { public: // Function to find the sum of contiguous subarray with maximum sum. int maxSubarraySum(vector &arr) { int prefix = 0,MaxSum = INT_MIN; for(int i = 0;i
@AryanShrivastav-n2v20 күн бұрын
Gltt ha bhai..prefix vala line sum kr nicche aayga
@rahulpatil68718 ай бұрын
yaha tk smja ya ni smja ,haan ji bhaiya samj gya😂
@mahuaranu44357 ай бұрын
HW problem ans 1:15:03 int max_difference(int arr[], int n){ int suffix = arr[n-1]; int maxi = INT32_MIN ; int diff = 0; for(int i = n-2; i>=0; i--){ suffix = max(suffix , arr[i]); diff = suffix - arr[i]; maxi = max(maxi , diff); } return maxi; }
@Anonymous_EngineerX8 ай бұрын
Kadane's algo to be honest outstanding explanation Thanks bhaijaan
@rohanbarwade5785 ай бұрын
best mentor ever
@GayatriShejule-o1k24 күн бұрын
Thank you so much sir 🥰
@aayushrajpurohit3218 ай бұрын
#Chamaka diya bhaiya it was an amazing session.
@saadrml4 ай бұрын
bhaiya, i think there is slight mistake at 48:54 prefix( mein 2 aane pe) maxi(jo pehle se 7 tha ) usko 2 update nhi karenge , balki 7 hi rehne denge , i hope someone finds its correct 🕊
@_hulk748 Жыл бұрын
Great Video as always sir🙏🙇♂✨💖
@GoogleSoftwareEnginear Жыл бұрын
Bhaiyo itna badiya content bhaiya hme de rhe hai to Subscribe to bnta hai sabhi kre Thank you so much Bhaiya for this amazing DSA series 😊😊👍👍
@atifmalik80123 ай бұрын
int equalSubarray(vectorA) { int prefix=0,Totalsum=0; for(int i=0;i
@ankushladani496 Жыл бұрын
Done Bhaiya... 39/180 ✅
@OsamaShabih2 ай бұрын
Chamak gya bhaiya 😊
@Sangi-sj2dy7 ай бұрын
Simply Awesome
@nitinpal880 Жыл бұрын
bhaiya apki vajah se improvement dekh para hu bhot jyada bas revision ka tarika bhi bata do aap
@abhisheksinghmehra9576 Жыл бұрын
Amazing explanation bhai as always🔥🔥🔥
@PinkuModi-c6i6 ай бұрын
bhaiya yaar apne pucha tha ki beech me to ni aa rhe h ad, but aa rhe h-av just aaya jab main 33:15 time stamp pe pahucha aur jaise hi ek question complete hua!!
@heetpatel303711 ай бұрын
Chamka bhaiya thank you 👍🏻
@rejaulislam259313 күн бұрын
alhamdulillah lec done
@AnuragSingh-im2md17 күн бұрын
Answer for the last question: int n = nums.size(); int suffix = nums[n-1]; int ans = 0; int diff; for(int i = n-2; i>=0; i--){ diff = suffix - nums[i]; ans = max(ans , diff); suffix = max(suffix , nums[i]); } if(ans==0) return -1; else return ans; o(n) T.C
@arpitkhandelwal82806 ай бұрын
amazing lecture bhaiya
@HiisbnxkskkwlАй бұрын
49:10 time stap pae toh 7 bada ha toh vohi rahega na sir
@ankushladani496 Жыл бұрын
Thanks Bhaiya...❤🎉
@Coder-rohits Жыл бұрын
maza aa gaya bhaiya🙌
@neerajrawat4294 Жыл бұрын
smallest sum contingous subarray is also a variation of kadane's algorithm;
@swapnadip Жыл бұрын
Good morning Bhaiya 😊🤗🤗
@vermapowerhub Жыл бұрын
Bhaiya aaj aapne day nhi dala video discription m ,ki konsa day h 180 days challenge ka ☺️
@Updatedknowledge9 Жыл бұрын
Maza aa gya 😊😊😊😊❤
@atifmalik80123 ай бұрын
23:08 //i tried it myslef without watching //In this approch i made two verctors one is prefix other one is suffix //if the perticular index in prefix is same as the element present at index+1 in suffix then return true otherwise false(for all elements) class Solution { public: bool canPartition(vector& nums) { int n = nums.size(); vectorprefix(n); vectorsuffix(n); prefix[0] = nums[0]; for(int i = 1;i=0;i--){ suffix[i] = suffix[i+1] + nums[i]; } for(int i = 0;i
@amritpathak86305 ай бұрын
Great effort
@csforcommonsense336011 ай бұрын
tq for ur lots of efforts
@DesiMrBean7 Жыл бұрын
Good morning negi bhai❤
@shailjayadav7995 Жыл бұрын
Good Morning Bhaiya❤
@GOATSOFFOOTBALL6 ай бұрын
completed,samajh aya
@study-yd6es5 ай бұрын
Amazing Content !!!
@AzeemKhan-oe8rt Жыл бұрын
bhai mujhse homework nhi ho paa rha, jbke me solution sochta rehta hoon 1-2 hours but code me convert ho hi nhi paa rha hai?
@shubhamkumarjha9192 Жыл бұрын
Good morning Bhaiya..❤️
@CoderArmy9 Жыл бұрын
Good morning bhai❤
@AzeemKhan-oe8rt Жыл бұрын
last wale 2-3 lecture nhi dekh paaya yaha se continue kr skata honnn?????????/ @coder army
@AMITKUMAR-ds4hp Жыл бұрын
Good morning boss ❤❤❤
@Armoured_Traveller Жыл бұрын
Day 39 Bhaiya ek motivational video chahiye apka🎉🎉❤
@sourabhgupta14667 ай бұрын
best lecture bhai
@Rishi_s.corner11 ай бұрын
chamak gaya bhaiya.
@Codewithkumar-gc1kr2 ай бұрын
chamak gaya elder brother😊😊 09-Nov-24
@NoorulAbdeenSiddiqui6 ай бұрын
u are the best
@Lifeofmoana225 ай бұрын
thankyou bhaiyaaa
@Saumyasingh000111 ай бұрын
Great explanation but i think at 18 min par jo inner loop par 2n kah rahe hai wo 2n nahi hoga waha par dono inner loop milakar n time he chala tho n hona chahiye 😅
@divyanshsharma67310 ай бұрын
In worst case, first loop will run n-1 times and the second will 1 time. So n((n-1)+1) = n². It could be for both end so this is why it's 2n.
@akashkewat1219 Жыл бұрын
Completed 😊.
@SnatanGaming21 күн бұрын
I AM UNABLE TO SOLVE LAST 2 Questions OF THE HOMEWORK SHEET I FOUND THIS LECTURE A BIT TOUGH CONSIDERING ALL THE PREVIOUS LECTURES,BECAUSE IN ALL PREVIOUS HOMEWORK SHEET I ATLEAST THINK OF AN APPROACH TO SOLVE BUT IN THIS LECTURE I AM UNABLE TO DO THAT ALSO.I HAVE TO PRACTICE HARD:(
@joydeep-halder Жыл бұрын
H/W Solutoin: : Maximum prefix sum for a given range vector ans; for (int i = 0; i < Q; ++i) { int start = L[i]; int end = R[i]; int maxPrefix = INT_MIN; int prefix = 0; for (int j = start; j
@utkarshawasthi4791 Жыл бұрын
❤
@jeetusingh61823 ай бұрын
i < Q what does it mean in third line
@TayyabaYasmine3 ай бұрын
Any one know in which lactures he covers the operator overloading and prefis and post fix operator overloading function
@joydeep-halder Жыл бұрын
Good morning bhaiya ❤❤
@CoderArmy9 Жыл бұрын
Good morning bhai❤
@joydeep-halder Жыл бұрын
@@CoderArmy9 😊😊
@parthh111211 ай бұрын
48:55 error 7>2 so no update needed
@karankumar3983 Жыл бұрын
Logic behind kadanes algorithm 55:00 to 59:08 kadanes ke pichhe ka kala such 😅
@GaziZai11 ай бұрын
Thanks
@nishikantDalal3 ай бұрын
Maximum Difference between 2 element code: int ans=0; int suffix_max=arr[n-1]; for(int i = n - 2 ; i >= 0 ; i - -){ ans=max(ans , suffix_max - arr[i]); if(arr[i] > suffix_max) suffix_max = arr[i] ; } return ans ;
@jiraiyagaming6491 Жыл бұрын
Good morning 🌞
@CoderArmy9 Жыл бұрын
Good morning bhai❤
@santanudebnath1283 Жыл бұрын
MAX DIFFERENCE #include using namespace std; int main() { int n,max_diff=0,ans; int arr[10]; coutn; cout=0;i--) { if(arr[i]>prefix) prefix=arr[i]; else { ans=prefix-arr[i]; max_diff=max(ans,max_diff); } } cout
@techmcu5 ай бұрын
if I'm not wrong bhaiya n-1 indicating last element position
@sarikasaxena5567 Жыл бұрын
max difference between 2 element solution: #include using namespace std; int main(){ int n; cin>>n; vector v(n); for(int i =0;i>v[i]; } int ans=0; int suffix=v[n-1]; for(int i = n-2;i>=0;i--){ if(suffix
@diyaseth9688 Жыл бұрын
Thank you bhaiya
@bsufeotxe Жыл бұрын
bhaiya dutch national flag problem bhi samjha do pointer ki help se
@lotifurshabbir7302 Жыл бұрын
1:00:59 vaia here if i wrote that if condition before updating the maxi line, will it work correctly?
@AakashParvani Жыл бұрын
Day 39/180 👍✅ Chamak Gaya
@drlovephukn Жыл бұрын
Day's 39/180 full power full power ❤❤❤
@asad_iliyas Жыл бұрын
9:29 howework
@prashantsingh347410 ай бұрын
1:15:03 hw maximum diffrence between two elements:- int maximumDifference(vector& n) { int su=INT_MIN , maxi=INT_MIN, sub=; for(int i=n.size()-1;i>=1;i--){ su=max(su, n[i]); sub=su-n[i-1]; maxi=max(sub, maxi); } return maxi; }
Bhaiya can't we just sort the array first in max difference between 2 elements
@bee.eee.5 ай бұрын
Noo, because the order of element matters, it says the we can only subtract an element from an element which is to it's right side (doesn't matter how far) So yes, if we sort it the order will be neglected and we will basically end up getting Max element - min element which is not the required answer.