#include <stdlib.h>
#include <stdio.h>


void fib(int **arr, int n) {
    *arr = malloc(sizeof(int) * n);
    *arr[0] = 0;
    int index = 1;

    if (n>=2) {
        *arr[1] = 1;
        index = 2;
    }

    while (index < n) {
        *arr[index] = *arr[index - 1] + *arr[index -2];
        index ++;
    }
}

int main(int argc, char **argv) {
    /* do not change this main function */
    int count = strtol(argv[1], NULL, 10);
    int *fib_sequence;

    fib(&fib_sequence, count);
    for (int i = 0; i < count; i++) {
        printf("%d ", fib_sequence[i]);
    }
    free(fib_sequence);
    return 0;
}
build a dynamic array containing the first n fibonacci numbers, assuming that n is greater than or equal to 1.