Determine if a string is collapsible: Difference between revisions
Determine if a string is collapsible (view source)
Revision as of 07:57, 18 November 2019
, 4 years ago→Condensed version:
Line 149:
" --- Harry S Truman "]
collapse(s) = (t = isempty(s) ? "" : s[1:1]; for c in s if c != t[end] t *= c end; end; t)
for s in teststrings
|