6 kyu

Midtown Navigator

143 of 221K-Calderon-ASC
Description
Loading description...
Fundamentals
  • Please sign in or sign up to leave a comment.
  • Madjosz Avatar

    JS, Python: The input strings always have ordinals with "th" while correcly you'd have "?1st", "?2nd", and "?3rd" for all numbers which can occurr in the inputs.

  • Madjosz Avatar

    In the description examples what do these E and W stand for? East and West? And if so, does this play any role in the solution?

                         v
    start = "5th Ave and W 46th St"
    end   = "7th Ave and E 58th St"
                         ^
    
    • LosBlobbos Avatar

      If I remember correctly W means West of 5th Ave and E East of 5th Ave So for 46th st and 7th ave it would be "7th Ave and E 46th St".

      So it does not matter for the solution

      Question marked resolved by LosBlobbos 2 years ago
  • LosBlobbos Avatar
  • Sokas Avatar

    could be more interesting if one would stay on the same street and/or same avenue, and Puck's suggestion with "1 block" too, but I still liked.

  • Puck Avatar

    Snakey Snake Python translation

    🐍

    Please review and approve.

  • Puck Avatar

    Example in description says midtownNav("8th Ave and W 38th St", "7th Ave and W 36th St") // output => "Walk 2 blocks south, and 1 block east"

    Test cases only accept blocks.

    Don't know if it's actually an issue but... it gave me extra work for nothing

    • Sokas Avatar

      You would just need ("s" if b != 1 else ""). I started to have more extra work when I assumed one would stay on the same street and/or avenue. :)

    • user9644768 Avatar
      Issue marked resolved by user9644768 5 years ago
    • Puck Avatar

      You would just need ("s" if b != 1 else "").

      That's what I did and that's the extra work I was talking about.. cause I'm lazy and I had to write that for nothing xD

  • IntuCode Avatar

    Nice little problem, gives a challenge in sorting the problem out and working on "tolerance for tediance.""