Tried the 1->2->3->4 and the output its not the correct answer


#1

I used the 1->2->3->4 in the expected output and this happens.
imagen

Maybe its and error, or not just reporting ^^.


#2

Read the input format carefully
" Line 1 ( Corresponds to arg 1 ) : Elements in the linked list. First number S is the number of nodes. Then S numbers follow indicating the val in each of the nodes in sequence For example, LinkedList: “5 --> 9 --> 7” will be written as “3 5 9 7”(without quotes)."

This should answer your question


#3

Yeah, :sweat_smile:
Thank you