Summarize and say sequence: Difference between revisions

Content added Content deleted
Line 2,415: Line 2,415:
=={{header|Julia}}==
=={{header|Julia}}==
<lang julia>const seen = Dict{Vector{Char}, Vector{Char}}()
<lang julia>const seen = Dict{Vector{Char}, Vector{Char}}()
int2chararray(n) = [s[1] for s in string.(split(string(n), ""))]


function findnextterm(prevterm)
function findnextterm(prevterm)
Line 2,457: Line 2,456:
maxsequences = Vector{Pair{Int, Vector{Char}}}()
maxsequences = Vector{Pair{Int, Vector{Char}}}()
for i in 1:maxseed
for i in 1:maxseed
seq = findsequence(int2chararray(i))
seq = findsequence([s[1] for s in split(string(i), "")])
seqlen = length(seq)
seqlen = length(seq)
if seqlen > maxseqlen
if seqlen > maxseqlen