Jump to content

Anagrams/Deranged anagrams: Difference between revisions

m
(→‎{{header|Lua}}: added Lua solution)
m (→‎{{header|Lua}}: restructure)
Line 2,299:
local answer = { word="", anag="", len=0 }
for _,list in pairs(dict) do
if #list >1 and #list[1]>answer.len then
for _,word in ipairs(list) do
for _,anag in ipairs(list) do
if deranged(word, anag) and #word>answer.len then
answer.word, answer.anag, answer.len = word, anag, #word
end
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.