I bet most C/C++ coders didn't free memory of deleted nodes in their accepted solutions. But Java is still faster than C/C++...
I do not know Java. I also have this question. I guess those who use Java use more built in functions from STL than C++ and C.
Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.