Ad
  • Default User Avatar

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

  • Custom User Avatar

    I agree. Although the difficulty of 6kyu would be well-deserved in a language like C.

  • Custom User Avatar

    seems to be approved already

  • Custom User Avatar

    fixed

  • Custom User Avatar

    fixed

  • Custom User Avatar

    I think this is more of a 7kyu :)

  • Custom User Avatar

    This was a fun one :)

  • Custom User Avatar

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

  • Custom User Avatar

    Hey, thanks for giving a detailed explanation of your approach. I really appreciate it. I like your approach and think it's a good one.

    I've also found over the years that it often helps to try and model my human thinking to code as much as possible. I too often forget this and try to write some beautiful and perfect solution the first time :)

  • Default User Avatar

    I'm really bad at math equations. I don't know how to express my ideas through pure math. So I didn't. I drew the street the same way the description does.

    1| |6
    3| |4
    5| |2

    I imagine I'm looking at a map (bird's eye view). I imagine driving from the south of the map to the north. You'll always know the first house on the left, and the last house on the right with the info they give us. I focused on that. I picked one side. What's going on the left side? What happens in real life when you're looking at addresses? The same thing. You notice the address changing the number. One side is even, one side is odd (in my area, the houses change by 4). So how much are they changing on my drawing? I'm not worried about writing a clean one line math equation. My code even has an even side, and an odd side and it still works with out using a giant list. You don't have to worry about making the cleanest smartest mathemetical code. Break it down how you as a human solve the answer.

    I'm in my car driving from the bottom of the map, to the top. I am looking on the left. I know how many houses are on this block and that odds are always on the left. How much is the number changing and in which direction? This is the approach I took that helped me.
    -Signed, someone really bad at math

  • Custom User Avatar

    Ooo, that looks interesting. Will be sure to give it a try next time :p

  • Custom User Avatar

    I'd also recommend putting any pattern into https://oeis.org/

  • Custom User Avatar

    Hmm interesting, I'll give that a go, thanks.
    I mostly create little tables as comments in my code and then see if a pattern emerges. It's amazing how our ape brains can do these things...

  • Custom User Avatar

    I'm similar tbf. One trick I use is - if there is just one input - to plot the input and output on a graph. You can then see if there is an obvious solution :)

  • Custom User Avatar

    Curious to know how people go about solving katas like this. I just try and identify some sort of formula through trial and error.
    I come up with a guess for a formula and test it with some inputs. I keep repeating until I hit something. This doesn't seem
    very efficient but not sure how else to solve problems like this...

  • Loading more items...