Timeline for Can my 4-note music box play that song?
Current License: CC BY-SA 3.0
8 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Jan 28, 2016 at 22:49 | comment | added | Neil | Oh, so the bit I was missing was that each split list must consist of the same value, and those values must alternate. Thanks! | |
Jan 28, 2016 at 22:09 | comment | added | FryAmTheEggman |
@Neil Sure, no problem :) From there, we do the subtraction to get: [[1], [-1, 1], [-1]] and [[1], [-1, -1], [1]] from here, you can see that the first one does not have lists that alternate between -1 and 1 while the other list does, giving the final result. The algorithm is a bit obtuse, but it's basically mapping direction changes to 0 and direction as +/-1 , then checking that no jumps are made and the directions make sense.
|
|
Jan 28, 2016 at 22:02 | comment | added | Neil | I think I'm more confused than before, so could you please finish those two examples to explain how the (correct) results are achieved? | |
Jan 28, 2016 at 20:55 | comment | added | FryAmTheEggman |
@Neil 1221221 is false and 1221441 gives true overall, but if I understand you want the result after that step in the algorithm? If that is the case it gives: from [3, 0, 1, 3, 0, 1] to [[3], [1, 3], [1]] and [3, 0, 1, 1, 0, 3] to [[3], [1, 1], [3]] . Let me know if you want something else explained :)
|
|
Jan 28, 2016 at 20:36 | comment | added | Neil |
What do you mean by "the results are split on 0"? In particular, what would you get for 1221221 and 1221441 ?
|
|
Jan 26, 2016 at 21:59 | history | edited | FryAmTheEggman | CC BY-SA 3.0 |
edited body
|
Jan 26, 2016 at 21:54 | history | edited | FryAmTheEggman | CC BY-SA 3.0 |
added 42 characters in body
|
Jan 26, 2016 at 20:49 | history | answered | FryAmTheEggman | CC BY-SA 3.0 |