Ad
  • Default User Avatar

    I didn't liked this problem at all..
    especially the one of the initial test case given is

    assertEquals(2, Hallway.contact(">-----<-->--<-----"));

    now if there are two -- how come expected is 2? that means we are talking about persons colliding each other only, and not just coming in contact.
    on two -- after taking one step each, both will come face-to-face, and as per the details, it should be taken as contact. so answer should be 1.
    This contradicted many times on random tests..for me.