You need to sign in or sign up before continuing.×
Ad
  • Custom User Avatar

    No, because there is more space between 5 and 10 (5) than between 1 and 5 (4). First you maximize the space, then if there is a tie, you chose the closest to the exit.

  • Custom User Avatar

    Since you enjoy sequences, here's a puzzle for you: Can you figure out the next values in this sequence and what they represent? [-1, -1, -1, -1, ...] Bonus question: does the accumulated sum of this sequence diverge towards "negative infinity"?

  • Custom User Avatar

    Hold on a moment. A puzzle provides some clues, but you need to deduce the specifications on your own. Aren't you familiar with this basic concept?

    write code according to specification

  • Custom User Avatar
  • Custom User Avatar

    There's no valid kata issue presented. You don't explain how these "things" are wrong. If you carefully analyze the example, it should make sense. Keep in mind that this is a puzzle kata, so it's not meant to be a straightforward task.

    And watch out with your "demented" language when commenting. This isn't a COD lobby, you know?

  • Custom User Avatar

    exactly, this is a puzzle, and a crucial part of it is hiding expected results

  • Custom User Avatar

    This comment has been reported as abusive

  • Custom User Avatar

    As in "it smells really funky"?
    After realizing the assignment makes no sense as given, I had not zero but "negative infinity" motivation to try to divine what the clown who formulated it meant.

    Unless completelly rewritten, it should be given as a prime example of how not to write a Kata.

    The words before some absurd graph (as in mapping input to output) should actually make sense. It would be better to word it "given such sequence of input/output mappings, divine an algorithm that will pass some BS tests".

  • Custom User Avatar

    Absolutely demented "Kata", the assignment is extremely unclear, the labeling "patients/chairs" on the table is worse than wrong, suggested numbers certainly don't correspond to the insinuated "as far from others as possible, break ties by rounding down".

    Extreme re-wording or nuking this brain-fart are the only options.

  • Custom User Avatar

    It works now

    It's just a math logic :)

    anyway Thx for reply me hahah

  • Custom User Avatar

    It's unfortunate that the author's intention wasn't fully realized. They were clearly seeking some degree of optimization. However, the issue lies in the fact that ranking inflation was already a widespread practice at that time.

  • Custom User Avatar

    I think that I personally would prefer softening the tests to standards of 7 kyu kata. I think it is reasonable to accept O(n) solutions for this particular kata, as there is many yellows which require performant factorization.

  • Custom User Avatar

    I checked your code and it is, unfortunately, too slow. It works well for small numbers, but works very, very sloooowly for larger numbers.

    It's a bit of a bad luck, because usually, white kata are meant to have no special performance requirements and should accept also some kinds of non-performant solutions. Unfortunately, this challenge does not follow this pattern. It can be considered more difficult than other 7 kyu kata, especially for newbies.

  • Custom User Avatar

    My Code Correct but Timed Out

  • Custom User Avatar

    Doesn't work correctly HOW?

  • Loading more items...