Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
22
Task/Rep-string/NGS/rep-string.ngs
Normal file
22
Task/Rep-string/NGS/rep-string.ngs
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
tests = [
|
||||
'1001110011'
|
||||
'1110111011'
|
||||
'0010010010'
|
||||
'1010101010'
|
||||
'1111111111'
|
||||
'0100101101'
|
||||
'0100100'
|
||||
'101'
|
||||
'11'
|
||||
'00'
|
||||
'1'
|
||||
]
|
||||
|
||||
F is_repeated(s:Str) (s.len()/2..0).first(F(x) s.starts_with(s[x..null]))
|
||||
|
||||
{
|
||||
tests.each(F(test) {
|
||||
local r = is_repeated(test)
|
||||
echo("${test} ${if r "has repetition of length ${r} (i.e. ${test[0..r]})" "is not a rep-string"}")
|
||||
})
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue