Why output contains 0

programming
Tags: #<Tag:0x00007f18283fe250>

#1


#2

Because random pointer of that node is NULL;
you should make sure that your LL node’s random pointer should point to NULL if the corresponding node of input LL is pointing to NULL.