Ad
  • Custom User Avatar

    Do you remeber what was the problem? I have the same problem now and idk what's wrong.

  • Custom User Avatar

    i had the same idea except i pushed directions to new array instead of removing them from original and that didn't work right =/
    error is just a hair away

  • Custom User Avatar

    Random test cases not going through on C++ but it's probably just because of my code. Off to next one.

  • Custom User Avatar
  • Custom User Avatar

    I don't recall anything having a reference to &str in the details of this, but if we want to discuss the details of the task:

    Your task is to write a function that takes a string and return a new string with all vowels removed.

    It states that you are taking a string, and returning a new string. So modifying the existing string and returning it is not the same as returning a new string, as described in the assignment. If there is a by reference involved in the solution's template, that may be an update to the kata from the time this, and many other solutions were written. But in any event, the details of the task tell you to return a new string, not the one that was sent to the function.

    /shrug

  • Custom User Avatar

    on decrypt the test is expecting " at the end of the return string? C++

    Expected: equal to "This is a test!"
    Actual: "This is a test!

    Edit. Got it working with different solution.

  • Custom User Avatar

    If the take in parameter is marked '&str' (as it is in the assignment. '&' is removed in this solution) you are supposed to use the original string directly through reference. This reduces memory usage and increases speed =)
    Anyway this is how i see it. Correct if am wrong.

  • Custom User Avatar

    for loop is cheating.

  • Custom User Avatar

    I don't see how the string is being passed by reference, as you need to specify by reference in the function parameters, and would change how we access the data within the string. But regex_replace creates an empty result string, and then populates and returns it based on the regex rules against the original string. It is not modifying the original string.

  • Custom User Avatar

    removing stuff from the assignment is bad practice imo
    the str is passed as reference
    otherwise well done and thank you for showing this

  • Custom User Avatar
  • Custom User Avatar

    i prefer this approach

  • Custom User Avatar

    you right my bad !

  • Custom User Avatar

    The tests are fine, read the description again:

    Each letter of a word scores points according to its position in the alphabet: a = 1, b = 2, c = 3 etc.

  • Custom User Avatar

    Tests must be broken or something: climbing is actually > volcano.
    On attempt it expects to return quotation marks as well: expected "this", actually got "this ...
    But i have seen this completed by more experienced programmer so it should be possible.

    On C++.

  • Loading more items...