diff --git a/Competitive Coding/Dynamic Programming/Maximum Circular Subarray Sum b/Competitive Coding/Dynamic Programming/Maximum Circular Subarray Sum new file mode 100644 index 000000000..6bb046f22 --- /dev/null +++ b/Competitive Coding/Dynamic Programming/Maximum Circular Subarray Sum @@ -0,0 +1,65 @@ +// Program to calculate Maximum Circular Subarray Sum + +#include +using namespace std; + +// Kadane Algorithm to find the Maximum Sum of continuous elements in an array +int kadaneMax(int arr[], int n) { + int ans = arr[0], prevBest = arr[0]; + for(int i=1; i> n; + int arr[n]; + for(int i=0; i> arr[i]; + } + cout << MaxCircularSubarraySum(arr, n); // print maxSum + return 0; +}