Ad
  • Custom User Avatar

    closing as there's completions in C++

  • Default User Avatar

    Ive just completed the task in C++ and nothing seems broken at least to me.

  • Default User Avatar

    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[0];
        
        return NULL;
    }
    
    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[0] freaking out. doh.

  • Default User Avatar

    Fully agree.
    I have done some annoying trial and error to find the correct rules.
    This should be explained in detail in the description, otherwise it is impossible
    to solve the Kata with the first try.

    There should further be a comment that strings between angle brackets <...> are not shown
    on stdout/stderr (with C++). That also bothered me at the beginning for some time.

  • Custom User Avatar

    Just one suggestion.
    I found this kata particularly hard and not because the exercise it's hard by itself.
    I found it hard because I think instructions could be somewhat improved:

    1.- Explain invalid characters.
    I know there is awesome people that can see this rule even if it is not present in the visible test cases/examples. But mortals like me needed to change their design several times because each time a new rule appeared.

    2.- Explain that several spaces or underscores must be replaced by single spaces.
    Again, I'm just a mortal, and took me a long time to be guessing some rules that weren't explained.

    Despite of this it's a good kata, thanks for this kind of exercises.
    Regards!.

  • Default User Avatar

    How do you explain that 174 guys passed the Ruby kata and 1832 in all languages? Algorithms are the same in all languages.

  • Custom User Avatar

    Sorting was Hard, took my time to figure out what type of sorting was required.
    Also achieved to solve it for "N" strings instead of 2 only.

  • Custom User Avatar

    This will work for "N" strings, not just for 2.

  • Default User Avatar

    What is broken exactly? can you post the errors and mark as spoiler so people can help?
    There are 30+ successful submissions in C++

  • Default User Avatar

    The tests are validating the tree by converting it back to an array, and the meesage comes from the assertion on arrays.

  • Custom User Avatar

    Seems like C++ tests are broken. Had to make it in C#.

  • Custom User Avatar

    C++ random test segfaults, but maybe you can submit your answer as C. Solution should be similar and C test doesn't segfaults.