diff --git a/Algorithms/Dynamic Programming/buy_sellStock.cpp b/Algorithms/Dynamic Programming/buy_sellStock.cpp new file mode 100644 index 00000000..377e7adc --- /dev/null +++ b/Algorithms/Dynamic Programming/buy_sellStock.cpp @@ -0,0 +1,27 @@ +#include +#include +#include +using namespace std; +int main(int argc, char **argv) +{ + long long int n; + cin>>n; + long long int arr[n]; + for(int i=0;i>arr[i]; + } + long long int buy1=INT_MAX; + long long int buy2=INT_MAX; + long long int sell1=0; + long long int sell2=0; + for(int i=0;i