Learn from leetCode
Some strategy learning from leetCode
C++ 2d array
Better use a vector(don’t need to consider allocator)
int row = 10;
int col = 10;
int init = 1;
vector<vector <int>> memos(row, vector<int>(col, init)) // init can ignore
int** a = new int*[rowCount];
for(int i = 0; i < rowCount; ++i)
a[i] = new int[colCount];
delete ...
Traverse a tree
The tree structure: