diff --git a/Buy and Sell Stock/README.md b/Buy and Sell Stock/README.md new file mode 100644 index 0000000..b21172f --- /dev/null +++ b/Buy and Sell Stock/README.md @@ -0,0 +1,29 @@ +``` +class Solution { +public: + int maxProfit(vector& prices) { + + int i, j, k, min = INT_MAX; + int max = 0; + k = prices.size(); + if(k==0) + { + return 0; + } + int sum; + for(i=0; imax) + { + max = prices[i]-min; + } + } + + return max; + } +}; +```