aboutsummaryrefslogtreecommitdiff
path: root/max_num_k_div_comp.c
diff options
context:
space:
mode:
Diffstat (limited to 'max_num_k_div_comp.c')
-rw-r--r--max_num_k_div_comp.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/max_num_k_div_comp.c b/max_num_k_div_comp.c
index c57b983..7139709 100644
--- a/max_num_k_div_comp.c
+++ b/max_num_k_div_comp.c
@@ -61,13 +61,12 @@ int main() {
int e1i[4][2] = {{0, 2}, {1, 2}, {1, 3}, {2, 4}}, v1[] = {1, 8, 1, 4, 4};
int e2i[6][2] = {{0, 1}, {0, 2}, {1, 3}, {1, 4}, {2, 5}, {2, 6}},
v2[] = {3, 0, 6, 1, 5, 2, 1};
- struct two_d_arr e1, e2;
- two_d_arr_init(&e1, 4, 2, e1i);
- two_d_arr_init(&e2, 6, 2, e2i);
- printf("%d\n", maxKDivisibleComponents(5, e1.arr, e1.row_size, e1.col_size,
+ struct two_d_arr *e1 = two_d_arr_init(4, 2, e1i);
+ struct two_d_arr *e2 = two_d_arr_init(6, 2, e2i);
+ printf("%d\n", maxKDivisibleComponents(5, e1->arr, e1->row_size, e1->col_size,
v1, ARRAY_SIZE(v1), 6)); // expect: 2
- printf("%d\n", maxKDivisibleComponents(7, e2.arr, e2.row_size, e2.col_size,
+ printf("%d\n", maxKDivisibleComponents(7, e2->arr, e2->row_size, e2->col_size,
v2, ARRAY_SIZE(v2), 3)); // expect: 2
- two_d_arr_free(&e1);
- two_d_arr_free(&e2);
+ two_d_arr_free(e1);
+ two_d_arr_free(e2);
}