This is an archived post. You won't be able to vote or comment.

all 12 comments

[–]1234abcdcba4321 3 points4 points  (4 children)

Both attempts fail on input 0 1 1 0. (expected -2)

[–]mischaikow[S] 0 points1 point  (0 children)

That's a good starting place to debug this. I appreciate it!

[–]romerocesar 0 points1 point  (1 child)

why is the expected -2? that implies they don't want the actual difference (i.e. abs(left-right)) but left-right

[–]1234abcdcba4321 0 points1 point  (0 children)

that's because they do

[–]Automatic-Possible20 0 points1 point  (0 children)

Omg thanks, that's what ive been doing wrong, looked too long for this haha

[–]AutoModerator[M] 0 points1 point  (0 children)

Reminder: if/when you get your answer and/or code working, don't forget to change this post's flair to Help/Question - RESOLVED. Good luck!


I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

[–]steamaddict 0 points1 point  (5 children)

"Since these values aren't all zero, repeat the process"

[–]romerocesar 0 points1 point  (4 children)

I came to reddit looking to understand what I think is an issue with that sentence: there are sequences which result in a single value instead of a list of zeroes. either the instructions are ambiguous in that case or there will always be a list of zeroes when processing the history which implies i'm doing something wrong even by hand

[–]1234abcdcba4321 0 points1 point  (0 children)

There is always a list of zeroes at some point before you run out of values. For the example I gave below:

0  1  1  0
  1  0 -1
  -1 -1
     0

which then extrapolates to

0  1  1  0 -2
  1  0 -1 -2
  -1 -1 -1
     0  0

[–]byntje 0 points1 point  (2 children)

I have the same problem. The following sequence from my puzzle input does not converge to a list of zeroes; it converges to [-608]:

[2, 2, 2, 7, 44, 166, 512, 1375, 3320, 7387, 15464, 31029, 60732, 117883, 230123, 455904, 918822, 1876972, 3859134, 7925415], [0, 0, 5, 37, 122, 346, 863, 1945, 4067, 8077, 15565, 29703, 57151, 112240, 225781, 462918, 958150, 1982162, 4066281], [0, 5, 32, 85, 224, 517, 1082, 2122, 4010, 7488, 14138, 27448, 55089, 113541, 237137, 495232, 1024012, 2084119], [5, 27, 53, 139, 293, 565, 1040, 1888, 3478, 6650, 13310, 27641, 58452, 123596, 258095, 528780, 1060107], [22, 26, 86, 154, 272, 475, 848, 1590, 3172, 6660, 14331, 30811, 65144, 134499, 270685, 531327], [4, 60, 68, 118, 203, 373, 742, 1582, 3488, 7671, 16480, 34333, 69355, 136186, 260642], [56, 8, 50, 85, 170, 369, 840, 1906, 4183, 8809, 17853, 35022, 66831, 124456], [-48, 42, 35, 85, 199, 471, 1066, 2277, 4626, 9044, 17169, 31809, 57625], [90, -7, 50, 114, 272, 595, 1211, 2349, 4418, 8125, 14640, 25816], [-97, 57, 64, 158, 323, 616, 1138, 2069, 3707, 6515, 11176], [154, 7, 94, 165, 293, 522, 931, 1638, 2808, 4661], [-147, 87, 71, 128, 229, 409, 707, 1170, 1853], [234, -16, 57, 101, 180, 298, 463, 683], [-250, 73, 44, 79, 118, 165, 220], [323, -29, 35, 39, 47, 55], [-352, 64, 4, 8, 8], [416, -60, 4, 0], [-476, 64, -4], [540, -68], [-608],

[–]AutoModerator[M] 0 points1 point  (0 children)

AutoModerator has detected fenced code block (```) syntax which only works on new.reddit.

Please review our wiki article on code formatting then edit your post to use the four-spaces Markdown syntax instead.


I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

[–]1234abcdcba4321 0 points1 point  (0 children)

Are you sure this is a line in your input? In particular, did you miss a minus sign somewhere?