#include <stdio.h>
#include <stdlib.h>
struct node {
int val;
struct node *next;
};
typedef struct node NODE;
int main() {
int arr1[] = {12, 43, 56, 34, 98};
int arr2[] = {85, 97, 100};
int size1 = sizeof(arr1) / sizeof(arr1[0]);
int size2 = sizeof(arr2) / sizeof(arr2[0]);
NODE* current,*previous,*head;
for (int i = 0;i < size1;i++){
current
= (NODE
*)malloc(sizeof(NODE
)); current->val = arr1[i];
if (i != 0){
previous->next = current;
}
else{
head = current;
}
current->next = NULL;
previous = current;
}
while(head != NULL){
head = head->next;
}
}
I2luY2x1ZGUgPHN0ZGlvLmg+CiNpbmNsdWRlIDxzdGRsaWIuaD4gCnN0cnVjdCBub2RlIHsKICAgIGludCB2YWw7CiAgICBzdHJ1Y3Qgbm9kZSAqbmV4dDsKfTsKdHlwZWRlZiBzdHJ1Y3Qgbm9kZSBOT0RFOwoKCmludCBtYWluKCkgewogICAgaW50IGFycjFbXSA9IHsxMiwgNDMsIDU2LCAzNCwgOTh9OwogICAgaW50IGFycjJbXSA9IHs4NSwgOTcsIDEwMH07CiAgICBpbnQgc2l6ZTEgPSBzaXplb2YoYXJyMSkgLyBzaXplb2YoYXJyMVswXSk7CiAgICBpbnQgc2l6ZTIgPSBzaXplb2YoYXJyMikgLyBzaXplb2YoYXJyMlswXSk7CiAgICAKICAgIE5PREUqIGN1cnJlbnQsKnByZXZpb3VzLCpoZWFkOwogICAgCiAgICBmb3IgKGludCBpID0gMDtpIDwgc2l6ZTE7aSsrKXsKICAgIAljdXJyZW50ID0gKE5PREUqKW1hbGxvYyhzaXplb2YoTk9ERSkpOwogICAgCWN1cnJlbnQtPnZhbCA9IGFycjFbaV07CiAgICAJaWYgKGkgIT0gMCl7CiAgICAJCXByZXZpb3VzLT5uZXh0ID0gY3VycmVudDsKICAgIAl9CiAgICAJZWxzZXsKICAgIAkJaGVhZCA9IGN1cnJlbnQ7CiAgICAJfQogICAgCWN1cnJlbnQtPm5leHQgPSBOVUxMOwogICAgCXByZXZpb3VzID0gY3VycmVudDsKICAgIH0KICAgIHdoaWxlKGhlYWQgIT0gTlVMTCl7CiAgICAJcHJpbnRmKCIlZCAiLGhlYWQtPnZhbCk7CiAgICAJaGVhZCA9IGhlYWQtPm5leHQ7CiAgICB9CiAgICAKfSAKCiAgICAKICAgIAogICAgCiAgICAKICAgIAogICAgCiAgICAKICAgIAogICAg