4 ms·
Does there exist a solution that doesn't rely on undefined repeat behavior? I finally gave in and looked at the answers, but it looks like they all use `repeat
by matchu 11y ago
Does there exist a solution that doesn't rely on undefined repeat behavior? I finally gave in and looked at the answers, but it looks like they all use `repeat M N>M`, or `repeat M N>currentOutputSize`.
I kinda assumed that the interpreter was just there for convenience, and that its implementation of undefined behavior was irrelevant. But is the interpreter's implementation critical to the solution?
(Then again, I'm now reading the examples and realizing that the implementation of undefined behavior was front-and-center, so that's kinda my bad xP)
- justinpombrio 11y agoGot it! cHJpbnQgMg0KcHJpbnQgMg0KcHJpbnQgMg0KcHJpbnQgMg0KcHJpbnQgMg0KcHJpbnQgMg0KcHJpbnQgMg0KcHJpbnQgMg0KcHJpbnQgMg0KcHJpbnQgMg0KcHJpbnQgMg0KcHJpbnQgMg0KcHJpbnQgMg0KcHJpbnQgMg0KcHJpbnQgMg0KcmVwZWF0IDMgMw0KcmVwZWF0IDIgMg0KcHJpbnQgMg0KcmVwZWF0IDMgMw0KcmVwZWF0IDIgMg0KcmVwZWF0IDMgMw0KcmVwZWF0IDIgMg==
- wgreenberg 11y agoAlthough I may be mistaken, LZ77 defines the repeat behavior to do exactly that: https://en.wikipedia.org/wiki/LZ77_and_LZ78#Example https://en.wikipedia.org/wiki/LZ77_and_LZ78#Example