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

struct Node {
    struct Node *next;
    int val;
};

struct Node *create2Nodes(int x, int y)
{
    struct Node *n2 = malloc(sizeof(struct Node));
    if (!n2) {
        return NULL;
    }
    n2->val = y;
    n2->next = NULL;

    struct Node *n1 = malloc(sizeof(struct Node));
    if (!n1) {
        free(n2);
        return NULL;
    }
    n1->val = x;
    n1->next = n2;
    return n1;
}

int main()
{
    struct Node *head = create2Nodes(100, 200);
    assert(head);

    printf("%d --> %d\n", head->val, head->next->val);

    free(head->next);
    free(head);
}
