-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.cpp
50 lines (40 loc) · 1.18 KB
/
main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#include <iostream>
#include "TutorialConfig.h.in"
#include <vector>
#include "letcode/solution.h"
#include "letcode/stock.h"
#include "letcode/parenth_gen.h"
using namespace std;
int main(int argc, char **argv)
{
vector<int> a = {1, 2, 3};
vector<int> b = {4, 5, 6};
ListNode* l1 = buildList(a);
ListNode* l2 = buildList(b);
Solution* so = new Solution();
ListNode* l = so->addTwoNumbers(l1, l2);
while (l)
{
cout << l->val << " ";
l = l->next;
}
cout << endl << "LeetCode Solution" << endl;
letcode::Solution* sl = new letcode::Solution();
vector<int> prices = {7,6,4,3,1};
cout << sl -> maxProfit(prices) << endl;
letcode22::Solution* sl22 = new letcode22::Solution();
vector<string> parenths = sl22->generateParenthesis(3);
for (const string item : parenths)
{
cout << item << endl;
}
if (argc < 2)
{
// report version
std::cout << argv[0] << " Version " << Tutorial_VERSION_MAJOR << "." << Tutorial_VERSION_MINOR << std::endl;
std::cout << "Usage: " << argv[0] << " number" << std::endl;
return 1;
}
std::cout << "Hello, world!\n";
return 0;
}