Notes
This function is in beta test. Please help improve it in the issues
here.
================================================================= ==2940==ERROR: AddressSanitizer: heap-use-after-free on address 0x61c000000080 at pc 0x00000051e7f1 bp 0x7ffe29686340 sp 0x7ffe29686338 READ of size 8 at 0x61c000000080 thread T0 #0 0x51e7f0 (/out/package/test_com+0x51e7f0) #1 0x51e718 (/out/package/test_com+0x51e718) #2 0x51e698 (/out/package/test_com+0x51e698) #3 0x51dc38 (/out/package/test_com+0x51dc38) #4 0x51df64 (/out/package/test_com+0x51df64) #5 0x52ee14 (/out/package/test_com+0x52ee14) #6 0x52edde (/out/package/test_com+0x52edde) #7 0x52ed9c (/out/package/test_com+0x52ed9c) #8 0x52ec50 (/out/package/test_com+0x52ec50) #9 0x52ea3f (/out/package/test_com+0x52ea3f) #10 0x52d143 (/out/package/test_com+0x52d143) #11 0x7f4908bc4b96 (/lib/x86_64-linux-gnu/libc.so.6+0x21b96) #12 0x41f3f9 (/out/package/test_com+0x41f3f9) 0x61c000000080 is located 0 bytes inside of 1792-byte region [0x61c000000080,0x61c000000780) freed by thread T
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
37, 22,15, 14,8,8,o, 7, ,4,r,4,4,-,-, 4,t,-,-,2,s,-,-,2,2,2,e,-,-,-,-, 2,a,-,-,-,-,-,-,y,u,-,-,-,-,-,-,p,j,i,h,f,d,-,-,-,-,-,-,-,-,-,-, c,\n,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,
JOJ Answer
37, 22,15, 14,8,8,o, 7, ,4,r,4,4,-,-, 4,t,-,-,2,s,-,-,2,2,2,e,-,-,-,-, 2,a,-,-,-,-,-,-,y,u,-,-,-,-,-,-,p,j,i,h,f,d,-,-,-,-,-,-,-,-,-,-, c,\n,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,