Ad
  • Custom User Avatar

    It should have been a 9. If you do the summation, it ends up being 8 short. (=558)

  • Custom User Avatar

    7 kyu seems too low for this kata.

  • Default User Avatar

    Hahaha, I wrote that comment 3 years ago! I resat the kata and tried again, this time with no hiccups.

  • Default User Avatar

    Seems to be too hard to be a 7 kyu?

  • Custom User Avatar

    If the resulting array is empty, calling first will yield nil, which needs to be converted into 0. This can be done either by using to_i or || 0.

  • Custom User Avatar

    Thanks. I have made the last newline mandatory in the Ruby tests.

  • Custom User Avatar

    .

  • Custom User Avatar

    There's a 'С' in the tests. It's not a capital 'C'.

  • Custom User Avatar

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

  • Custom User Avatar

    The given test cases assume the "Ja"'s and dots to be combined without spaces, while the actual test cases expect them to be seperated by spaces.

  • Custom User Avatar

    I see my flaw. I need to take into account the position of the element in the original array. That way the sequence between say two i in the result becomes the longest.

  • Custom User Avatar

    I'm trying to solve this with JavaScript. I think there's an issue with the random tests.

    When I get the following input, the expected is what the tests tell me and the "instead got" is my solution. The expected solution expects the second i before the second a, even the second a appears before the second i in the input.

    Input        ['i', 'a', 'd', 'h', 'f', 'j', 'a', 'k', 'j', 'c', 'i', 'e', 'd', 'i', 'a', 'b', 'i', 'h', 'e', 'h', 'g', 'g', 'g', 'j', 'i', 'k', 'k', 'k', 'b', 'f']
                   ^    ^                        ^                   ^
    Expected:    ['i', 'a', 'd', 'h', 'f', 'j', 'k', 'c', 'e', 'b', 'g', 'i', 'a', 'd', 'h', 'f', 'j', 'k', 'e', 'b', 'g', 'i', 'a', 'h', 'j', 'k', 'g', 'i', 'k', 'i'], 
                   ^    ^                                                 ^    ^
    instead got: ['i', 'a', 'd', 'h', 'f', 'j', 'k', 'c', 'e', 'b', 'g', 'a', 'j', 'i', 'd', 'h', 'e', 'g', 'k', 'b', 'f', 'i', 'a', 'h', 'g', 'j', 'k', 'i', 'k', 'i']
                   ^    ^                                                 ^         ^
    

    Even the second j should be before the second i.

  • Default User Avatar

    I keep getting an error

    TypeError: Cannot read property '9' of undefined
        at transitionFunction (test.js:127:56)
        at machine (test.js:10:50)
        at Context.<anonymous> (test.js:144:21)
    

    when calling the transitionFunction, which is really annoying. My solution works for the given tests and I cannot see what is wrong with me calling the way I do.

  • Custom User Avatar

    Since the two arguments are both booleans we can use them directly when comparing. This solution asks if I'm employed and (&&) not (!) on vacation. Since this is Ruby, the last executed line in a method is automatically returned.

  • Custom User Avatar

    This was not a 7 kyu in my opinion.

  • Loading more items...