Ad
  • 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

  • Default User Avatar
  • Default User Avatar

    You're right. I'd still like an explanation of the code. Can't find any in the comments

  • Default User Avatar

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

  • Default User Avatar

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

  • Default User Avatar

    For anyone else who might be having problems understanding the challenge...

    I thought the description was still a little tough to figure out, so this is for people attempting to understand the problem and who can't figure it out.
    Keep in mind (i DO NOT have a philosophy degree) so I apologize for any confusion!

    Looking at first example: string1 = abc, string2 = cde | STARTING HERE: (abc => cde)

    Step 1.
    Letter by letter, I change string2 by looking over string1.
    (a)bc => cde (no a's in string2)
    a(b)c => cde (no b's detected in string2)
    ab(c) => Cde (1 c detected in string2. swap all c's casings in string2. I don't care if it's upper or lower on the input) |sidenote: if the output(string2) was cCde, it changes to Ccde
    string2 = Cde

    Step 2.
    Do it again, swapping the new strings: string1 = abc, string2 = Cde | STARTING HERE:(Cde => abc)
    (C)de => abC (found 1 'c' in string2(once again, dont' care about it's casing on the input). change it's casing in the OTHER(output) string)
    C(d)e => abC (no d's)
    Cd(e) => abC (no e's)
    string 1 = abC

    Step 3.
    answer = string1 + string2
    answer = abCCde

    Remember: I dont care if the letter is currently(input) lower or upper, I just want to change any instances
    of that letter on the output to the opposite of what they were. If I have 2 of the same letter
    on my INPUT, the output of that step would look unchanged. (2 negatives = positive)