Needs random tests
Either I'm experiencing an incredible brain failure or merely trying to access a member of the input array causes a SIGSEGV signal.
I'm guessing that's what RafaARV means.
static TreeNode* arrayToTree(std::vector<int> arr)
int value = arr;
Process exited prematurely with a SIGSEGV signal.
EDIT: Even stranger, at() seems to work just fine, i.e.:
int value = arr.at(0);
EDIT 2: Just realised the first test is an empty vector, hence arr freaking out. doh.
To be completely honest I stole it from Codility. I just find CodeWars a much nicer environment and thought I'd give others the benefit of doing it here :)
I'm still figuring out the interface so I'll see how I can add random tests at some point.
Nice first kata! :-) Thanks.
You should add random tests.
You can print anything you want to STDOUT.
It would be nice to have a command line interface like the one exercism.io has.
Debugging seems to be an absolute bitch. Am I missing something or is the only output I'm allowed to see that of the tests? =/