int delete_user(const char *name, User **user_ptr_del) {
    
    User *delete_user = find_user(name, *user_ptr_del);

    if (delete_user == NULL){
        return 1;
    }

    // delete user from their friends' list
    for(int i = 0; i < MAX_FRIENDS; i++){
        if ((*delete_user).friends[i] != NULL){
            User *friend = (*delete_user).friends[i];
            // printf("%s\n", friend->name);
            for (int j = 0; j < MAX_FRIENDS; j++){
                if(friend->friends[j] != NULL){
                    // printf("%s\n", friend->friends[j]->name);
                    if (strcmp((*friend).friends[j]->name, name) == 0){
                        (*friend).friends[j] = NULL;
                    }
                }
            }
        }
    }

    // free the post the user recieved
    Post *curr_post = delete_user->first_post;
    while (curr_post != NULL){
        free(curr_post);
        curr_post = curr_post->next;
    }

    // delete user from the user list
    User *curr_before = NULL;
    User *curr = *user_ptr_del;
    User *curr_next = curr->next;

    while (curr != NULL){

        if (strcmp(name, curr->name) == 0){
            if (curr_before == NULL && curr_next == NULL){
                // printf("curr_before and curr_next is NULL\n");
                curr_before = NULL;
                curr = NULL;
                curr_next = NULL;
                free(curr);
            }else if (curr_before == NULL){
                // printf("curr_before is NULL\n");
                *user_ptr_del = curr_next;
                curr_before = NULL;
                curr = NULL;
                curr_next = NULL;
                free(curr);
            }else if (curr_next == NULL){ 
                // printf("curr_next is NULL\n");
                curr_before = NULL;
                curr = NULL;
                curr_next = NULL;
                free(curr);
            }else{
                // printf("all are not empty\n");
                curr_before = NULL;
                curr = NULL;
                curr_next = NULL;
                free(curr);
            }
        }
        curr_before = curr;
        curr = curr_next;
        curr_next = curr_next->next;
    }


    return 0;
}
From the list pointed to by *user_ptr_del, delete the user with the given name.
Remove the deleted user from any lists of friends.

Return:
- 0 on success.
- 1 if a user with this name does not exist.