Ad
  • Custom User Avatar

    To be fair, almost no tutorials teach you Big-O properly. I consistently hear of people that first learned about time and space complexity like 2-5 years after they already begun working as a developer.
    For some reason this isn't taught and unless you prepare for interviews at companies like google, you likely won't hear of this early on.
    I think it should be taught though, it really helps writing better code.

  • Custom User Avatar

    This is O(n^2), not great.

  • Custom User Avatar

    This kata is weird.

    I used x and y coordinates to determine the destination and then used those to simply return the most optimal route.

    Example: x: -1 y: 1 would be once WEST and once NORTH.

    The input array was:

    ['EAST', 'NORTH', 'SOUTH', 'NORTH', 'WEST', 'NORTH', 'SOUTH', 'NORTH', 'SOUTH', 'WEST']

    The expected answer is:
    ['EAST', 'NORTH', 'WEST', 'WEST']

    when in reality ['NORTH', 'WEST']
    would be the most optimal and time saving route.

    So now I have to wonder how to get a less optimal solution to fit the weird dependencies of this kata...

  • Custom User Avatar
  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution