alestane icon

Dictionary tree (verify child)

alestane | PRO | 02/03/14 02:57:00 PM UTC | 0 ⭐ | 345 👁️ | Never ⏰ | []
Lua |

230 B

|

None

|

0 👍

/

0 👎

local dictionary = {}
 
local function insertWord(dict, word)
    local head, tail = word:upper():match('^(%a)(%a*)$')
    if not head then return false; end
    if not dict[head] then dict[head] = {}; end
end
 
insertWord(dictionary, 'BAG')

Comments