-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.cpp
More file actions
34 lines (30 loc) · 829 Bytes
/
Copy pathtest.cpp
File metadata and controls
34 lines (30 loc) · 829 Bytes
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
#include "spiral_matrix.hpp"
static void runTest(std::vector<std::vector<int>>& matrix) {
Solution sol;
std::vector<int> result = sol.spiralOrder(matrix);
std::cout << "[";
for (size_t i = 0; i < result.size(); ++i) {
std::cout << result[i];
if (i != result.size() - 1) {
std::cout << ",";
}
}
std::cout << "]" << std::endl;
}
int main() {
std::cout << ">>>>>>>>>> example 1 <<<<<<<<<<" << std::endl;
std::vector<std::vector<int>> matrix1 = {
{1, 2, 3},
{4, 5, 6},
{7, 8, 9}
};
runTest(matrix1);
std::cout << ">>>>>>>>>> example 2 <<<<<<<<<<" << std::endl;
std::vector<std::vector<int>> matrix2 = {
{1, 2, 3, 4},
{5, 6, 7, 8},
{9, 10, 11, 12}
};
runTest(matrix2);
return 0;
}