Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
|
|
@ -0,0 +1,22 @@
|
|||
import util.
|
||||
|
||||
go =>
|
||||
println(1..4=non_cont(1..4)),
|
||||
L = "abcde".reverse(),
|
||||
println(L=non_cont(L)),
|
||||
println(ernit=non_cont("ernit")),
|
||||
println(aaa=non_cont("aaa")),
|
||||
println(aeiou=non_cont("aeiou")),
|
||||
nl,
|
||||
|
||||
println("Printing just the lengths for 1..N for N = 1..20:"),
|
||||
foreach(N in 1..20)
|
||||
println(1..N=non_cont(1..N).length) % just the length
|
||||
end,
|
||||
nl.
|
||||
|
||||
% get all the non-continuous subsequences
|
||||
non_cont(L) = [ [L[I] : I in S] : S in non_cont_ixs(L.length)].
|
||||
|
||||
% get all the index positions that are non-continuous
|
||||
non_cont_ixs(N) = [ P: P in power_set(1..N), length(P) > 1, P.last() - P.first() != P.length-1].
|
||||
Loading…
Add table
Add a link
Reference in a new issue