From ee7faa96866717842e7a6ad5b01da82f5f296527 Mon Sep 17 00:00:00 2001 From: Ayushi0901 Date: Sun, 10 Oct 2021 15:20:12 +0530 Subject: [PATCH] Add one more algorithm --- cpp/Ayushi0901_kadane'salgorithm.cpp | 33 ++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 cpp/Ayushi0901_kadane'salgorithm.cpp diff --git a/cpp/Ayushi0901_kadane'salgorithm.cpp b/cpp/Ayushi0901_kadane'salgorithm.cpp new file mode 100644 index 00000000..2a2e5c55 --- /dev/null +++ b/cpp/Ayushi0901_kadane'salgorithm.cpp @@ -0,0 +1,33 @@ +#include +#include +using namespace std; + +int main(){ + int n; + cin>>n ; + int arr[n]; + for(int i=0;i>arr[i]; + + } + int currSum=0; + int maxsum=INT_MIN; + +for(int i=0;i