Ad
  • Custom User Avatar

    Find the second-to-last element of a list.

    This is not ambiguous ( description might have changed in the past 7 (!) years ).

    Empty / singleton lists do not have a penultimate element, so there can be no tests with that ( and there aren't ). This might be specified, but if it hasn't been addressed in seven years, let's just not.

    Closing.

  • Default User Avatar

    Someone's fixed it.

  • Default User Avatar

    It's not just the fact that there's no mention of case sensitivity. It's that the kata description clearly says that all inputs will be lower case letters:

    The input string will only consist of lower case letters and/or spaces.

    The first test case (actually, the sample one as well) has an upper case letter which must be counted.

    IMHO, the kata description needs to be rewritten. Sure, a quick glance at the sample case shows what's going on, but to be neat and proper it should mention that in the description.

  • Default User Avatar

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

  • Custom User Avatar

    Translation into Ruby submitted :)

  • Custom User Avatar

    They seem all lowercase to me and you could fix it with a small fix in most languages.

  • Custom User Avatar

    +1, on python as well

  • Custom User Avatar

    It's ambigusous if it's second to last in the current string (ie l[-2] or 2nd biggest value (sorted(l)[-2]).

    On top of that, behaviour is unclear for empty/singleton lists.

  • Custom User Avatar

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