Ad
  • Default User Avatar

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

  • Default User Avatar

    The random tests for the Shell implementation appears to occasionally add extra spaces to the output.
    Encoded message: tvg3swhprr hj,

    Test Failed
    expected: "tvg3swhprr  hj,"
         got: "tvg3swhprr hj,"
    
  • Default User Avatar

    My bash script works, but it is not efficient enough to finish within 12000 ms. I made my best attempt at translating my completed Python solution to bash, but unfortunately, the bash version is too slow. Any suggestions for improving efficiency in bash? I am using associative arrays to convert between letters and their decimal equivalent. Is there a better/faster way to do that in bash? Also I am using bc to handle most mathematical calculations.

  • Default User Avatar

    Thank your for the assistance. I was able to complete this kata. I believe my original issue was caused my use of addition echo commands (used for testing/debugging) prior to the final echo output. Once these commands were commented out, the logging recieved the correct values.

  • Default User Avatar

    Is echo the proper way to return an output of a function in Bash? In my Bash script, I am storing the number of iterations as counter. My script finishes with echo $counter and the value printed to the console matches the expected output, but the the testing script says that it got 0.

  • Default User Avatar

    Wow that is embarassing. Thank you for pointing out my error. I was certain that I had counted all 15 requests in my solution. I am ashamed of myself.

  • Default User Avatar

    I appreciate your patience with my ignorance. I solved the above example by hand and came out with the exact same taxis as above:

    taxi 1: (3, 10), (14, 22), (26, 30)
    taxi 2: (8, 10), (16, 26), (27, 29)
    taxi 3: (9, 18), (19, 20), (21, 30)
    taxi 4: (16, 26), (29, 30)
    taxi 5: (17, 25), (29, 30)
    taxi 6: (19, 28)
    

    How are these not "distributed" correctly?

  • Default User Avatar

    I listed the six taxis above. The number of requests is small enough that it can be checked by hand, and while I may have missed something, I do not see any mistake. All 15 requests are satisfied with the six taxis that are show in my post.

  • Default User Avatar

    My code passes the basic tests and most of the small random tests, but on some tests it says I am off by one taxi. In the example below, it says there should be 7 taxis. I don't see how they are getting 7 taxis. What am I missing here?

    Requests:  [(19, 20), (9, 18), (8, 10), (17, 25), (27, 29), 
                (16, 26), (29, 30), (26, 30), (19, 28), (21, 30), 
                (29, 30), (19, 28), (3, 10), (16, 26), (14, 22)]
    Number of requests:  15
    
    Number of taxis:  6
    Taxis:
    [(3, 10), (14, 22), (26, 30)]
    [(8, 10), (16, 26), (27, 29)]
    [(9, 18), (19, 20), (21, 30)]
    [(16, 26), (29, 30)]
    [(17, 25), (29, 30)]
    [(19, 28)]