Ad
  • Custom User Avatar
  • Custom User Avatar

    then continue go up to flooor 6

    That's not going to happen.

    Kata description says

    The Lift never changes direction until there are no more people wanting to get on/off in the direction it is already travelling

    There is nobody above floor 4 so the lift won't keep going up...

    • Lift started on floor 0 ==> [0]
    • Lift goes to floor 2 and 2 people enter (wanting to go to floor 4). ==> [0,2]
    • Lift continues up to floor 4. The 2 people in lift get out and 2 people get in wanting to go fo floor 2 ==> [0,2,4]
    • There is nobody in floors above 4, so lift takes the occupants to floor 2. ==> [0,2,4,2]
      ... etc
  • Custom User Avatar

    This is not the proper way to raise an issue, and this is most likely not an issue (= a bug in the kata). If really you get different results in your IDE and here, there can be a difference between Java versions, or there is some bug in Java (I seriously doubt it), all o whiwh which CodeWars is obviously not responsible. Please read carefully the documentation: https://docs.codewars.com/training/troubleshooting/

  • Custom User Avatar

    Random test #10: 'pong-ping-pong-ping-boof-bink-doof-ping-smak-bong-ping-pong-ping-pong-ping-pong-ping-pong-ping-pong-flap-funk'. Expected = ping

    ping and pong scores are 1 and 2 correctly in my solution.

    Wrong.

    Kata is correct, because:

    • pong-ping-pong-ping-boof-bink-doof- -> pong serves, ping misses; Score ping=0,pong=1
    • ping-smak-bong- --> ping serves and misses; Score unchanged
    • ping-pong-ping-pong-ping-pong-ping-pong-ping-pong-flap-funk --> ping serves, pong misses; Score ping=1,pong=1

    Since final scores are even, "ping" wins because "pong" had the last bad shot.

  • Custom User Avatar

    Your solution is not working if it fails some tests. You should read the description carefully again, there are some important details you may be missing.