codinasion-archive / codinasion-monorepo

Community Monorepo
https://codinasion.org
MIT License
52 stars 167 forks source link

[Program]: Find the maximum sum of a contiguous subarray (Circular) #1702

Open harshraj8843 opened 2 years ago

harshraj8843 commented 2 years ago

Description

Write a program to find the maximum sum of a contiguous subarray (circular)

Maximum sum of a circular subarray is the task of finding the contiguous subarray within a circular one-dimensional array of numbers which has the largest sum. For example, for the sequence of values 10, -3, -4, 7, 6, 5, -4, -1; the contiguous subarray with the largest sum is 7, 6, 5, with sum 18.

Input  : [8, -8, 9, -9, 10, -11, 12]
Output : 22

Tracking Issues

GuyEternal commented 2 years ago

https://github.com/codinasion/codinasion/issues/1716