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 +};