Ad
  • Custom User Avatar

    Definitely clever, not sure why people tend to vote best practices on solutions that are nearing code golf level of cleverness though. If most people were straight up handed this code at their job, it'd take them a while to even figure out what it does, let alone work with it.

  • Custom User Avatar

    That was an excellent Kata.

    Piece of advice for everybody working on it: Read the description and think about what you know about the problem.

    Don't be like me, going down a rabbit hole of memoization, optimal factorization algorithms, and obscure code features, only to finally sit down and read the description carefully.

    This problem doesn't require any of that.

  • Default User Avatar

    That immediately solved it, thanks bkaes. I totally forgot about the hoops you have to go through to "copy" an object in Ruby.

    Changing it to dna.dup fixed it.

    Perhaps just constructing a new string would be better?

  • Default User Avatar

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

  • Default User Avatar

    Has the same problem whether I manipulate the input or not, going to post a screenshot.

  • Default User Avatar

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

  • Default User Avatar

    Input: GGGTTTTCTTTCACC
    Expected: "GGGTTTTCTTTCACC", instead got: "CCCAAAAGAAAGTGG"

    The random tests are expecting the output to be the same as the input.

  • Default User Avatar

    The random tests seem to be broken, they seem to expect the output to be the same as the input, instead of the complement.
    This is for the Ruby version.