Ad
  • Default User Avatar

    good job on the persistence

  • Custom User Avatar

    My solution still works, some other solutions still work for all available java versions, many solutions work with java 8 and fail with java 11.

    I'd say its still solvable, but for java 11 is either harder, or requires different steps than for Java 8

  • Custom User Avatar

    @wayne1512. LOL. Well, I warned you about that in the Kata description!

    I bet you won't ever catch a Lift (a.k.a. elevator) again without thinking of this Kata !

    Kudos for seeing it to completion.

  • Custom User Avatar

    Haha totally feel you! I have two such challenges which I've been thinking on for years! Managed to complete one, but Voronoi cells kata is still waiting :D

  • Custom User Avatar

    @wayne1512.

    Only people going the same direction as the Lift may enter it

  • Default User Avatar

    First, it seems you didn't read the description (at least, you didn't do it correctly). Second, it's almost impossible to answer to your question since the context is lacking like half of the constraints of the problem. ;)

  • Default User Avatar

    maybe because, as usual in java, there are getters for that? :p

    robot1.getName() => "Rocky"
    robot1.getHealth() => 100
    robot1.getSpeed() => 20
    robot1.getTactics() => ["punch", "punch", "laser", "missle"]
    
    robot2.getName() => "Missile Bob"
    robot2.getHealth() => 100
    robot2.getSpeed() => 21
    robot2.getTactics() => ["missle", "missle", "missle", "missle"]
    
  • Custom User Avatar

    Your solution posted below is failing tests 2-5. Then reaches timeout during test 6. The solution also timeouts even if tests 0-5 are skipped.

  • Default User Avatar

    I already warned you for a performance challenge when I had almost the same solution as you have. You are using constructs/elements that are not fast enough. Whith a little bit of creativity this is a solvable kata. Try to find different faster constructs/elements and you will succeed.

  • Custom User Avatar

    Put your code inside triple backtick to make it readable:

    ```java
    import java.io.IOException;
    ```
    

    The author's solution and accepted solutions that I tried doesn't timeout.

  • Custom User Avatar

    We've reduced it because the new runner performs much better. Also, 20s was set for more complex challenges on Qualified.io. 16s should be enough for this challenge.

  • Custom User Avatar

    I'm not sure I understand what you mean, but I guess you're asking about the order of the bytes read and written. If your example represents a timeline of calls to write() and read(), it's correct. The calls to flip() are missing though.

    I'll mark this question as resolved. If you have other questions, let us know.

  • Default User Avatar

    Yeah, the sequence of writing and reading must be te same.

    Be prepared for a performance challenge.