Skip to content

Instantly share code, notes, and snippets.

View Sushant-1999's full-sized avatar
🏠
Working from home

Sushant Sushant-1999

🏠
Working from home
  • Airtel X Labs
  • Pune
  • 15:01 (UTC +05:30)
View GitHub Profile
#include<cmath>
#include<iostream>
#include<climits>
using namespace std;
int Maximum_Sum_Subarray(int arr[],int n) //Overall Time Complexity O(n)
{
int ans = A[0],sum = 0;
for(int i = 1;i < n; ++i) //Check if all are negative
ans = max(ans,arr[i]);