If you want to instantiate a ListNode, Change ListNode node(0) to ListNode* node=new ListNode(0);
I changed my own code and it passed OJ.
What language are you talking about?
I'm referring to c++ :)
Both ways work. As long as you're using them correctly.
Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.