diff --git a/cpp/maximumSubarraySum.cpp b/cpp/maximumSubarraySum.cpp new file mode 100644 index 00000000..59cd67bf --- /dev/null +++ b/cpp/maximumSubarraySum.cpp @@ -0,0 +1,41 @@ +#include + +using namespace std; + + class Solution { +public: + int maxSubArray(vector& nums) { + int sum=INT_MIN,curr=0; + for(int i=0;i>t; + while(t--) + { + int n;//size of the input array + cin>>n; + int a; + vector v;//taking user input for the array + for(int i=0 ; i>a; + v.push_back(a); + } + int ans = obj.maxSubArray(v); + cout<