can not use new in cpp code? or I should use malloc, or write a construction function myself for this new operation of this struct?
There is only a constructor accepting a int value: RandomListNode(int x), no default constructor.
You must be using like new RandomListNode();
hah thanks, i tried malloc before and it's ok. I will use RandomListNode(int x) instead since now
Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.