diff --git a/best_time_to_buy_and_sell_stock.cpp b/best_time_to_buy_and_sell_stock.cpp new file mode 100644 index 0000000..fc5f588 --- /dev/null +++ b/best_time_to_buy_and_sell_stock.cpp @@ -0,0 +1,12 @@ +class Solution { +public: + int maxProfit(vector& prices) { + int maxPro = 0; + int minPrice = INT_MAX; + for(int i=0; i