• Courses
  • Tutorials
  • Jobs
  • Practice
  • Contests
April 14, 2022 |221.8K Views
Kadane’s Algorithm | SDE Sheet | Arrays
  Share  6 Likes
Description
Discussion

In this video we will learn how to find the sum of contiguous subarray within a one-dimensional array of numbers that has the largest sum. We will be using Kadane’s Algorithm to solve the problem in hand. 

Example: 

Input: [-2, -3, 4, -1, -1, 1, 5, -3] 

Output: Maximum contiguous array sum is 7 4 + (-1) + (-2) + 1 + 5 = 7 

Check out the video to see how we implement this!! 

Practice Problem: https://practice.geeksforgeeks.org/problems/kadanes-algorithm-1587115620/1 

Article: https://www.geeksforgeeks.org/largest-sum-contiguous-subarray/ 

SDE Sheet: https://www.geeksforgeeks.org/sde-sheet-a-complete-guide-for-sde-preparation/

Read More