diff --git a/C++/0053.cpp b/C++/0053.cpp new file mode 100644 index 0000000..c633eaa --- /dev/null +++ b/C++/0053.cpp @@ -0,0 +1,20 @@ +class Solution { +public: + int maxSubArray(vector& nums) { + int n=nums.size(),i; + int res=INT_MIN; + vector dp(n,0); + // dp[i] is the maximum sum subarray ending at i; + //Smallest Subproblem + dp[0]=nums[0]; + for(i=1;i