#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int maxProfit(vector<int>& prices) {
// TODO: find the maximum profit from a single buy/sell
return 0;
}
int main() {
vector<int> a = {7, 1, 5, 3, 6, 4};
vector<int> b = {7, 6, 4, 3, 1};
cout << maxProfit(a) << endl; // 5
cout << maxProfit(b) << endl; // 0
return 0;
}
Click Run to execute, or Submit to grade (all languages).