Ad
  • Custom User Avatar

    Math.sign(num) will return -1 if the number is negative I think.

  • Default User Avatar

    once you understand the description it's quite simple to solve. quite fun though, i like this kata

  • Custom User Avatar

    The solution itself is simple once you understand and solve the puzzle. The description is good, but only one part was confusing me. I misunderstood the communication part. I thought by communication it meant that they 1 can tell 2 & 3 their hat colors. That threw me off track for a bit. Once I understood that they can only guess their own hat I understood it was more of a probability problem. I hope this helps others who had the same confusion.

  • Custom User Avatar

    Kata hint != kata suggestion

  • Default User Avatar

    I copied and recived true: travel(r, zipcode) === "AA 45522:Paris St. Abbeville,Paris St. Abbeville/67,670" Problem only with this test. The other are passed

  • Custom User Avatar

    check you don't add a trailing space

  • Custom User Avatar

    WTF???
    expected 'AA 45521:Paris bd. Abbeville,Paris St. Abbeville/674,67' to equal 'AA 45521:Paris bd. Abbeville,Paris St. Abbeville/674,67'

  • Custom User Avatar

    OMG!!! I spent so much time thinking the addresses needed to be sorted by street names then street numbers. The kata turned out to be so much easier than I thought :)))

    Thank you so so much for your help!!!

  • Custom User Avatar

    Hi,

    there is no sorting invloved. You keep the order of the original sentence.

  • Custom User Avatar
  • Custom User Avatar

    Ruby 3.0 should be enabled (Refer this & this for more detail)

  • Custom User Avatar

    For some reason I don't seem to get how addresses within the required zipcode are being sorted.
    From what I understood, I am supposed to sort them by street name then street number, but some of the random test cases are coming back with errors that prove my understanding wrong. Can someone please explain to me what am I missing? Here's a sample test case that yields an error:

    expected 'OH 43071:Main Long Road St. Louisville,Main Street St. Louisville/432,123'
    to equal 'OH 43071:Main Street St. Louisville,Main Long Road St. Louisville/123,432'

    According to my sorting logic, Main Long Road should come before Main Street, which is the case. But according to the expected result it should have been the opposite.

    Can anyone explain to me why is that? Am I getting the sorting logic wrong?

  • Default User Avatar

    Your comment really helped. Thanks.

  • Default User Avatar

    Nice Kata with pretty nice catcher :D

  • Default User Avatar

    A very interesting and fun kata. First it makes you scratch your head until you realise what you've been doing wrong.

  • Loading more items...