#Retina, 62 43 26 bytes
Retina, 62 43 26 bytes
17 bytes thanks to @Martin Büttner.
^ 1111: M!&`(11+):(\1*) :
(Note the trailing newline.)
Input in unary in 1
, output in unary in 1
separated by newlines.
##Previous 43-byte version:
Previous 43-byte version:
.+
11:$&;111:$&;1111:$&
\b(1+):(\1*)1*
$1$2
Input in unary, output in unary separated by semi-colon (;
).
##Previous 62-byte version:
Previous 62-byte version:
.+
$&11;$&111;$&1111
((11)+)1*;((111)+)1*;((1111)+)1*
$1;$3;$5
Input in unary, output in unary separated by semi-colon (;
).