int delete_user(const char *name, User **user_ptr_del) {
    if (find_user(name, *user_ptr_del) == NULL) {
        // Check if a user with this name does not exist
        return 1;
    }
    int index = 0;
    User *curr = *user_ptr_del;
    while (curr != NULL) {
        // Traverse through every user in the user list
        index = find_friend(curr->friends, name);
        for (int i = index; i < MAX_FRIENDS; i++) {
            // Find the friend and delete them + "shift" the friend list elements accordingly
            // for EACH user
            if ((i == MAX_FRIENDS - 1) && (curr->friends[MAX_FRIENDS - 1] != NULL)) {
                // Edge case: when the friend to delete is at the end of the list
                curr->friends[i] = NULL;
            } else if (curr->friends[i] == NULL) {
                break;
            } else {
                // Technique for "shifting" elements: delete the user at the current index by
                // overwriting with the user at the next index
                curr->friends[i] = curr->friends[i + 1];
            }
        }
        curr = curr->next;
    }

    // Deleting the user

    User *curr_del = *user_ptr_del;
    // Edge case: user to be deleted is first in user list
    if (strcmp(name, curr_del->name) == 0) {
        *user_ptr_del = curr_del->next;
    }
    while ((curr_del->next != NULL) && (strcmp(name, curr_del->next->name) != 0)) {
        curr_del = curr_del->next;
    }
    if ((curr_del->next != NULL) && (strcmp(name, curr_del->next->name) == 0)) {
        // Normal case: user is not at the beginning or end of the user list
        curr_del->next = curr_del->next->next;
        curr_del->next->next = NULL;
    } else {
        // Edge case: user is at the end of the user list
        curr_del->next = NULL;
    }

    free(find_user(name, *user_ptr_del));

    return 0;
}

delete user