RosettaCodeData/Task/Rep-string/11l/rep-string.11l

19 lines
325 B
Plaintext
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

F reps(text)
R (1 .< 1 + text.len I/ 2).filter(x -> @text.starts_with(@text[x..])).map(x -> @text[0 .< x])
V matchstr =
|1001110011
1110111011
0010010010
1010101010
1111111111
0100101101
0100100
101
11
00
1
L(line) matchstr.split("\n")
print('#.' has reps #..format(line, reps(line)))