Ad
  • Custom User Avatar

    when did n choose k permutations become fundamentals; I feel like this should be listed as a maths problem

  • Custom User Avatar

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

  • Custom User Avatar

    Ah I see, thanks for your help :)

  • Custom User Avatar

    Ruby random tests expected result should be calculated before calling the user's function to avoid input mutation problems.

  • Custom User Avatar

    I was, I used String.slice! to remove portions of the string and insert them into an array. My return conditionals were placed above that code.
    If I change the code so I'm calling slice! on a clone instead, the code works, but I can't figure out why.

  • Custom User Avatar

    Are you somehow destroying the input value? Strings are mutable in Ruby.

  • Custom User Avatar

    Maybe someone can help me; when I run my solution it passes the basic tests but it immediately fails on the first random test no matter what.
    All the tests it fails on require me to return an empty string. At the top of my method I have an if conditional that returns an empty string
    if the the first argument is an empty string, if the second argument is greater than the length of the first argument, or if the second argument
    is less than or equal to zero. What exactly am I missing here?

  • Custom User Avatar

    pretty bad description, you say if pockets == nil i.e. if the first argument is nil, but what you really mean is if all the values in the hash are nil or empty arrays, or if the hash itself is empty.

  • Custom User Avatar

    This problem gave me clinical depression