Ad
  • Custom User Avatar

    Ya, it looks like you are removing the correct answer from the string itself. I recommend duplicating the input string before you begin to modify it, that way the input stays the same.

  • Custom User Avatar

    I'm not sure which language you use, apparently you mutate numbers:

    Do not mutate the original array/list.

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    Ruby (and probably Crystal and other languages too): strings are mutable and random test is vulnerable to input modification.

  • Custom User Avatar

    Resolved for a better issue (raised above)

  • Custom User Avatar

    Did you mutate the input string?

  • Custom User Avatar

    I'm not quite sure why the random tests in ruby are expected to display values outside the middle of the string. Maybe I'm missing something. Can someone explain why expected values exclude the middle characters for random tests and not for primary tests?

    Testing for bLXT
    It should work for random inputs too - Expected: "bT", instead got: "LX"
    Testing for hBRnHu
    It should work for random inputs too - Expected: "BH", instead got: "Rn"
    Testing for FSCfE
    It should work for random inputs too - Expected: "Sf", instead got: "C"