8 lines
155 B
C++

#include <bits/stdc++.h>
using namespace std;
class Solution
{
public:
int maxProfit(vector<int> &prices);
bool test(vector<int> &prices, int answer);
};