Dude seriously! This is the best explanation I've seen for this question. Keep up the good work!
@saptarshichattopadhyay82343 ай бұрын
Thank you so much sir...
@vishalbalani10682 жыл бұрын
The best explanation and video I have seen for Leetcode examples. Thanks a lot!!
@sudiptaranjan74052 жыл бұрын
you are awesome bro...Keep it Up... Love you man...🥰
@Premkumar-zk7lb3 жыл бұрын
mast approach tha bhai. thanks for this video 🙏
@meetshujah Жыл бұрын
love from pk
@abhijitbiradar2 жыл бұрын
great video
@snehajoywal172 жыл бұрын
I do not skip the ads for support u more and more and shares your videos to all my friends...one day I'll contribute u something... Just keep it up and hats off ☺️
@CodingWithPrakash_2 жыл бұрын
Krdo skip ads Focus on studies I will add more content
sir aap jab video upload kijiyega to please aise hi pahle bata dijiyega ki ye question kon kon sa company me pucha gaya aise me beginners ko kafi motivation milta hai..🙏
@NextInterviewPrep3 жыл бұрын
great
@sahebullah2194 Жыл бұрын
Man you are so underrated ! I will be the best if you would solve the whole dsa sheet Humble request please Even if you upload 2 videos a week or even provide a paid course But do it asap 🔥
@CodingWithPrakash_ Жыл бұрын
I will try!
@omkarsawant9267 Жыл бұрын
Summary: Using C language for Writing Code Current Max gets updated value if sum total of initial Current max add with apporaching value of array is greater than current max initial value. So after that Max sum value get updated. # include int kadanesAlgorithm(int arr[], int n){ int maxSum= arr[0]; // Encounters Max Sum encountered so far int CurrentMax=arr[0]; // Show max subarray's Sum for (int i=1;i arr[i])? CurrentMax + arr[i] : arr[i]; maxSum = (CurrentMax > maxSum) ? CurrentMax : maxSum; } return maxSum; } int main(){ int arr[] = {-2,-3,4,-1,-2,1,5,-3}; int n = sizeof(arr)/sizeof(arr[0]); int maxSum = kadanesAlgorithm(arr, n); printf("Largest Sum of Contiguos Subarray:%d ", maxSum); return 0; } Time complexity is O(n) because where n is the number of elements in the array. This is because it only requires a single pass through the array. Space Complexity is O(1) as no extra space required to store value as values are incrementing and getting assigned.