Ad
  • Default User Avatar

    To amplify the previous report in re the random tests expect the input as the result...
    Try this:
    public … {
    return array;
    }
    When you Attempt, it will pass the Random tests, and it shouldn’t.

    srfoster’s solution should work, but they had to do a workaround to get past the bug.

    Also, the problem wording is ambiguous (politically correct for “it sucks”). The actual solution does not match the scenario - the solution sucks up much more space.

    Better wording which matches the solution:
    “Write a function that takes a String array and returns a String array in which each element is the contatenation of all preceding elements plus the current element.”

    Wording which matches the scenario:
    “Write a function that concatenates the elements of a String array.”
    Then overhaul the solution and make it 8 kyu.