how can i improve this?
int **split_array(const int *s, int length) {
    int **result = malloc(sizeof(int*) * 2);
    if (length % 2 == 0) {
        result[0] = malloc(sizeof(int) * (length / 2));
    }
    else {
        result[0] = malloc(sizeof(int) * ((length / 2) + 1));
    }
    result[1] = malloc(sizeof(int) * (length / 2));

    int e = 0;
    for (int i = 0; i < length; i += 2) {
        result[0][e] = s[i];
        e++;
    }

    int o = 0;
    for (int i = 1; i < length; i += 2) {
        result[1][o] = s[i];
        o++;
    }

    return result;
}

/* Return a pointer to an array of ints with size elements.
   - strs is an array of strings where each element is the string
     representation of an integer.
   - size is the size of the array
 */

int *build_array(char **strs, int size) {
    int *ints;
    ints = malloc(sizeof(int) * size);

    for (int i = 0; i < size; i++) {
        ints[i] = strtol(strs[i + 1], NULL, 10);
    }

    return ints;
}
