How do you get the value from a node? The class is "ListNode" but it is defined no where. I have tried node->value or node->data but neither works?
I forgot to mention I use C++
I have found the answer, it is node->val
Sorry for the inconvenience. I have fixed this by including the definition of ListNode in the default code definition comments. You can click on the reload code definition button above the code editor to view the newest code definition.
Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.