Ad
  • Custom User Avatar

    (1) and (3) are overrated, and (1) should not have been translated to Python ( or at least certain imports should have been forbidden ).

    I don't have an opinion on (0) or (2) because I've never been able to solve them.

  • Custom User Avatar

    Rules and assertions

    • All test arrays will be 2+ in length

    The specs say that case must not exist. Which makes it perfectly valid to optimise for the specs, and check the base case after the first iteration.

  • Custom User Avatar
  • Custom User Avatar

    Is it unreasonable to rank a kata on its simplest possible solution

    I think so, yes. There are solutions to Become Immortal which make the kata look like it could have been 6kyu. There are many other kata whose solutions can be much simpler than their rank might imply.

    Having said that, even the naive approach to this kata should be able to solve it with just a a few loops and simple variables. No advanced algorithms are needed, there's no hidden information. There are tools that make it easier if you know about them, but even without them I think this should be a 6kyu at best, and I think 7kyu is fine.

  • Custom User Avatar

    approved

  • Custom User Avatar
  • Custom User Avatar

    I thought it was a fun problem, but also felt it was probably a 5 or 6 kyu. I know that's feedback which has already been given.
    If there isn't one already, I'd suggest a test case which has a single element array. Most base case conditions seem to use array.length==1, which has that kind of input as a potential vulnerability.