From 6d47bd88c21934c73290b7e4e87cd406a717711c Mon Sep 17 00:00:00 2001 From: Chelcy-millenika <54374275+Chelcy-millenika@users.noreply.github.com> Date: Fri, 2 Oct 2020 23:46:52 +0530 Subject: [PATCH] Update Best-Time-to-Buy-and-Sell-Stock-II.cpp --- C++/Best-Time-to-Buy-and-Sell-Stock-II.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/C++/Best-Time-to-Buy-and-Sell-Stock-II.cpp b/C++/Best-Time-to-Buy-and-Sell-Stock-II.cpp index 3c2f8e3c..116a37bf 100644 --- a/C++/Best-Time-to-Buy-and-Sell-Stock-II.cpp +++ b/C++/Best-Time-to-Buy-and-Sell-Stock-II.cpp @@ -8,6 +8,7 @@ class Solution int maxProfit(vector &prices) { int sum = 0; + int count =sum; //If the number of element in the array are zero or one just return zero. if (prices.size() == 1 or prices.size() == 0) { @@ -29,4 +30,4 @@ class Solution return sum; } -}; \ No newline at end of file +};