Skip to main content

Timeline for Collapse Adjacent Duplicates

Current License: CC BY-SA 3.0

15 events
when toggle format what by license comment
Nov 10, 2017 at 4:36 comment added FryAmTheEggman @Jordan Thanks, but this answer was specifically written to handle what I would think is a "list" in Retina: some tokens separated by a consistent separation token, perhaps being bookended by another token. Using trailing whitespace as a requirement feels like its not really in the spirit of a list. In any case, feel free to post that as a separate answer!
Nov 9, 2017 at 18:09 comment added Jordan If you take input as a space-separated list (with a trailing space) on a single line, you can do the same thing as my sed solution in 13 bytes (or maybe fewer, since I don't really know Retina).
Jul 24, 2017 at 23:31 history edited FryAmTheEggman CC BY-SA 3.0
deleted 78 characters in body
Jul 22, 2017 at 7:40 comment added Martin Ender @FryAmTheEggman Not sure whether that's what Neil meant but you could then also use m to turn the \bs into ^ and $.
Jul 22, 2017 at 1:13 comment added FryAmTheEggman @Neil I only see how to save 1 (\S -> .). As far as I can tell the rest is the same?
Jul 22, 2017 at 1:12 comment added FryAmTheEggman @Shaggy Go ahead!
Jul 21, 2017 at 23:47 comment added Neil You could save 2 bytes by requiring a newline-delimited list.
Jul 21, 2017 at 22:56 comment added Shaggy Nicely done :) Do you mind me posting my Japt solution seeing as it's now extremely derivative of this?
Jul 21, 2017 at 22:45 comment added FryAmTheEggman @Shaggy Don't be sorry! Thanks for finding the problem! I added another boundary check to fix that case.
Jul 21, 2017 at 22:44 history edited FryAmTheEggman CC BY-SA 3.0
added 5 characters in body
Jul 21, 2017 at 21:58 comment added Shaggy I've since discovered that this'll also fail on _89 89 _87 _8 _88, outputting _89 89 _87 8. Sorry :\
Jul 21, 2017 at 21:55 comment added FryAmTheEggman @Shaggy Thanks, I corrected it by adding a boundary check and using _ to denote negatives, as is common in some languages.
Jul 21, 2017 at 21:54 history edited FryAmTheEggman CC BY-SA 3.0
added 15 characters in body
Jul 21, 2017 at 21:46 comment added Shaggy Worked up an identical solution in Japt before spotting this. Unfortunately, we both fail on inputs such as -89 89 -87 -88 -88, which outputs --87.
Jul 21, 2017 at 21:01 history answered FryAmTheEggman CC BY-SA 3.0