Data update
This commit is contained in:
parent
aec8ed51b6
commit
29a5eea0d4
128 changed files with 1298 additions and 0 deletions
24
Task/Rep-string/ABC/rep-string.abc
Normal file
24
Task/Rep-string/ABC/rep-string.abc
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
HOW TO RETURN repstrings str:
|
||||
PUT {} IN reps
|
||||
FOR len IN {0..floor(#str/2-1)}:
|
||||
PUT str|floor(#str/2-len) IN rep
|
||||
PUT rep IN rpt
|
||||
WHILE #rpt < #str: PUT rpt^rep IN rpt
|
||||
IF rpt|#str = str: INSERT rep IN reps
|
||||
RETURN reps
|
||||
|
||||
PUT {} IN tests
|
||||
PUT "1001110011" IN tests[1]
|
||||
PUT "1110111011" IN tests[2]
|
||||
PUT "0010010010" IN tests[3]
|
||||
PUT "1010101010" IN tests[4]
|
||||
PUT "1111111111" IN tests[5]
|
||||
PUT "0100101101" IN tests[6]
|
||||
PUT "0100100" IN tests[7]
|
||||
PUT "101" IN tests[8]
|
||||
PUT "11" IN tests[9]
|
||||
PUT "00" IN tests[10]
|
||||
PUT "1" IN tests[11]
|
||||
|
||||
FOR t IN tests:
|
||||
WRITE t, repstrings t /
|
||||
Loading…
Add table
Add a link
Reference in a new issue