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.

  • 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

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

  • 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

    Same here. And I have been writing JS for more than half a decade now..
    Thanks! :)

  • Custom User Avatar
  • Custom User Avatar

    Well, it's actually some pretty basic JavaScript. Did you try with some for loops and a count variable that you'll return?

  • Custom User Avatar

    This resource should be helpful: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/Reduce
    It is a useful method that you can use to solve this challenge. 🙂

  • Custom User Avatar

    Haha it took me 10 seconds.

  • Custom User Avatar

    Kata ranks cannot be changed.

  • Default User Avatar
  • Default User Avatar

    The rankings for kata are all over the place. What you have to know to actually code the solution for this is 8 kyu as it is a simple string return. But figuring out the amount of each is harder. A lot of the Kata's are very algorithm specific. If you have solved a similar problem before they are trivial, if you have to come up with a solution they can be very difficult.

  • Custom User Avatar

    Me too... But the "higher species" decided in a different way.))

  • Custom User Avatar

    @sajadtorkamani .. Ooooh Boy , I miss your comments Sajad :blush: :relaxed: , The last time commented you were 4kyu :wink:

    • You made my day Bro :blush: :+1:
    • It's a rare comment to meet on CW , thanks for such a positive feedback :relaxed:
    • Hope that just sharpen a little skills :wink:
    • Hope you the best Sajad On/Off the site :+1: .. Regards .. Zizou
  • Loading more items...