Ad
  • Default User Avatar

    How does the from_roman catch things like "IX" being equal to 9?

  • Custom User Avatar

    It would be more efficient to use elifs here rather than 3 ifs, as if an earlier if is true, later ones won't be.

  • Custom User Avatar

    Your code is a pleasure to read! The most readable solution, congrats!

  • Default User Avatar

    I want to ask a question. What does the bitwise operator '|' do in this code?

  • Default User Avatar

    This looks so readable! I still have much to learn. Thanks

  • Default User Avatar

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

  • Default User Avatar

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

  • Default User Avatar

    I am new to codewars, how can I see the unit tests used when I press "Attempt" button? (not the ones in the "Sample Tests")

    EDIT:
    Figured it out, just need to print out the input array in the function and it will show up in the Log of failed tests.

    Here is the "testUpAndDown":

    capacity = 5;
    input: ({3}, {2}, {0}, {2}, {}, {}, {5})
    expectedResult: {0, 1, 2, 3, 6, 5, 3, 2, 0}

  • Default User Avatar
    • you should be able to get the input by yourself
    • expected: no idea since that does not match any of the fixed tests that I saw...

    As you can see, your message and the information you gave are not really clear, for now... :o

  • Default User Avatar

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

  • Default User Avatar

    actually, it does matter, but you have to considere the direction wanted by the different people too.

  • Default User Avatar

    I solved this problem in C++, I passed all the test cases but I could not submit my code.. Does it mean TLE or something? I couldn't see any warnings about it

  • Default User Avatar

    Thanks. I feel the word "queue" in problem description is kind of confusing, it turns out that the order doesn't matter at all...

  • Custom User Avatar

    [0,1,5,6,5,1,0,1,0]

    This one is REALLY well named... "Tricky queues". As long as you do not find the expected answer, that means you do not have the correct algo.

  • Default User Avatar

    What is the expected result for this test case?

    capacity: 5
    floor 0:
    floor 1: 0 0 0 6
    floor 2:
    floor 3:
    floor 4:
    floor 5: 6 6 0 0 0 6
    floor 6: