Ad
  • Custom User Avatar

    not a kata suggestion

  • Custom User Avatar

    Powerful Tom cat can catch a lot of mice every day, in order to show his naughtiness and generosity, let mouse number off, first batch eats the numbers of single. Then re-queue, The second batch still eats the numbers of single. The third batch is the same, until there's only one left, and it can survive.

    Can be changed to:

    Powerful Tom catches a lot of mice every day. But in order to show his naughtiness and generosity he always lets one mouse go. First he eats each mouse in the odd positions, rounds up the remaining mice and repeats the process, until there is just one mouse left.

    Still clunky but I didn't want to change the structure.

  • Custom User Avatar

    Your less idiomatic solutions using add1 and sub1 intrigue me.
    I wonder if this style disregards efficiency though.

  • Custom User Avatar

    Needs performance tag.

    Requires O(log n) solution; O(n) won't do. That's ok, but solvers deserve fair warning about that.

  • Default User Avatar

    Powerful Tom cat can catch a lot of mice every day, in order to show its naughtiness and generosity,

    It appears the word its refers to Tom, yes? If so, use the word his, not its. That was immediately confusing.

    Put a space between position and to where you have positionto

    So... is Jerry a mouse or a rat? They're not the same thing, and if we're talking "Tom & Jerry" here, he is certainly a mouse.

    Please consider completely starting over in describing the steps to take. This is the main ISSUE here. Have the friend read the description (without knowing what it's supposed to mean) and then have them explain it back to you.

  • Custom User Avatar

    I changed some descriptions, is it getting better?

  • Custom User Avatar

    solved.

  • Custom User Avatar

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

  • Custom User Avatar

    solved.

  • Custom User Avatar

    The input range should be increased because of this.

  • Custom User Avatar

    10000 random tests is too much and solutions starts to look like micro-optimization since even good solutions take like 10 seconds. If you want to test for performance, you need to add a performance tag.

  • Custom User Avatar

    Needs fixed test with n being a power of 2 as an edge case. They only appear in the random tests.

  • Default User Avatar

    The description is totally incomprehensible. I still have no idea how it could be related to what's tested.

  • Custom User Avatar

    solved.

  • Custom User Avatar

    Needs Random Tests.

  • Loading more items...