diff --git a/Best Time to Buy and Sell Stock b/Best Time to Buy and Sell Stock new file mode 100644 index 0000000..f9a75b5 --- /dev/null +++ b/Best Time to Buy and Sell Stock @@ -0,0 +1,14 @@ +class Solution { +public: + int maxProfit(vector& prices) { + int maxprofit=0; + int minsofar=prices[0]; + int n= prices.size(); + for(int i=0 ; i