Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

4
  • 1
    \$\begingroup\$ That one is really nice. You can golf it down to 55 bytes though : perl -nE 's/\d+/$.&=!@a||1~~[map{abs$_-$&}@a];push@a,$&/eg;say$.' : -n instead of <>=~ which allows you to get rid of /r modifier. use \d+ and then $& instead of (\d+) and $1. !@a instead of 0>$#a. $.&= instead of $.&&=. push@a,$& instead of @a=(@a,$&) \$\endgroup\$ Commented Oct 24, 2016 at 17:21
  • \$\begingroup\$ For some reason, my system tells me the new file is 55 bytes long, which is obviously wrong because it's only 54 characters, so ??? \$\endgroup\$ Commented Oct 24, 2016 at 17:55
  • \$\begingroup\$ Hmm that's strange. (and I have no idea where this comes from). But I'm pretty sure it's only 54 (the PPCG-Design script tells me 54, and my bytecount app tells me 54 aswell). \$\endgroup\$ Commented Oct 24, 2016 at 17:58
  • 2
    \$\begingroup\$ Is it possible the byte count was out due to the file having an unnecessary newline at the end? \$\endgroup\$ Commented Oct 25, 2016 at 1:12