Notes
This function is in beta test. Please help improve it in the issues
here.
================================================================= ==50648==ERROR: AddressSanitizer: heap-use-after-free on address 0x6060000001c8 at pc 0x00000051bcf5 bp 0x7ffe22248380 sp 0x7ffe22248378 READ of size 8 at 0x6060000001c8 thread T0 #0 0x51bcf4 (/out/package/pre1+0x51bcf4) #1 0x51c364 (/out/package/pre1+0x51c364) #2 0x51c40c (/out/package/pre1+0x51c40c) #3 0x522a3d (/out/package/pre1+0x522a3d) #4 0x7f53309b8b96 (/lib/x86_64-linux-gnu/libc.so.6+0x21b96) #5 0x41f359 (/out/package/pre1+0x41f359) 0x6060000001c8 is located 40 bytes inside of 56-byte region [0x6060000001a0,0x6060000001d8) freed by thread T0 here: #0 0x518538 (/out/package/pre1+0x518538) #1 0x51c3c7 (/out/package/pre1+0x51c3c7) #2 0x51c40c (/out/package/pre1+0x51c40c) #3 0x522a0f (/out/package/pre1+0x522a0f) #4 0x7f53309b8b96 (/lib/x86_64-linux-gnu/libc.so.6+0x21b96) previously allocated by thread T0 here: #0 0x5177c0 (/out/package/pre1+0x5177c0) #1 0x51c04c (/out/packag
Hints
Your answer may be identical to the JOJ answer in the first several lines.
However, the main problem you meet now is Runtime Error. And the exit code of your program is 1, which should be 0.
Please double check your code to solve this problem and try again.
Your Answer
Simple tree test. find path: 1 10 sum: 15 depth: 3 allPathSumGreater: 0 1 covered_by: 0 contained_by: 1 traversal: 6 3 3 1 2 3 312 1 12 2 3 1 2 3 6 copy: passed
JOJ Answer
Simple tree test. find path: 1 10 sum: 15 depth: 3 allPathSumGreater: 0 1 covered_by: 0 contained_by: 1 traversal: 6 3 3 1 2 3 312 1 12 2 3 1 2 3 6 copy: passed