Timeline for String Concatenation
Current License: CC BY-SA 3.0
9 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Apr 13, 2017 at 12:39 | history | edited | Community Bot |
replaced http://codegolf.stackexchange.com/ with https://codegolf.stackexchange.com/
|
|
| Sep 23, 2016 at 15:14 | comment | added | cia_rana | @m-chrzan Great! I added your answer. | |
| Sep 23, 2016 at 15:13 | history | edited | cia_rana | CC BY-SA 3.0 |
added 210 characters in body
|
| Sep 23, 2016 at 15:01 | comment | added | m-chrzan |
61 bytes, input as an array of strings: ->a{a.sort_by!(&:size);a[0].chars.map{|c|a[1].sub!c,""};a*?_}
|
|
| Sep 23, 2016 at 15:00 | comment | added | cia_rana | @m-chrzan Oh, I didn't observe carefully the question. Thanks! | |
| Sep 23, 2016 at 14:56 | history | edited | cia_rana | CC BY-SA 3.0 |
deleted 53 characters in body
|
| Sep 23, 2016 at 14:39 | comment | added | m-chrzan |
Also, I think you need to name the lambda in this case, since you do end up calling it. However, doing a,b=b,a if a.size>b.size to exchange the strings is non-recursive, and saves you another byte.
|
|
| Sep 23, 2016 at 14:23 | comment | added | m-chrzan |
gsub! doesn't work here - you're supposed to remove the first occurance of each letter. Fortunately, sub!, which does exactly that, is a byte shorter.
|
|
| Sep 23, 2016 at 10:45 | history | answered | cia_rana | CC BY-SA 3.0 |