Add tasks for all the new languages
This commit is contained in:
parent
9dc3c2bb62
commit
bba7bfd280
13208 changed files with 134745 additions and 0 deletions
15
Task/Rep-string/Sidef/rep-string.sidef
Normal file
15
Task/Rep-string/Sidef/rep-string.sidef
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
var arr = <1001110011 1110111011
|
||||
0010010010 1010101010
|
||||
1111111111 0100101101
|
||||
0100100 101 11 00 1>;
|
||||
|
||||
arr.each { |n|
|
||||
if (var m = /^(.+)\1+(.*$)(?(?{ substr($1, 0, length $2) eq $2 })|(?!))/.match(n)) {
|
||||
var i = m[0].len;
|
||||
say (n.substr(0, i),
|
||||
n.substr(i, i).tr('01', '𝟘𝟙'),
|
||||
n.substr(i*2));
|
||||
} else {
|
||||
say "#{n} (no repeat)";
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue