132. Word Search II
Code ( Language :C++) ( Judger :ip-172-31-21-252) Edit class trieNode { public : trieNode *child[ 26 ]; string word; trieNode(){ for ( int i = 0 ; i < 26 ; i++){ child[i] = NULL ; } word = "" ; } }; class trieTree { public : trieNode *root; trieTree(){ root = new trieNode(); } void insert ( string word) { trieNode *copy = root; int size = word.size(); if (size == 0 ){ return ; } for ( int i = 0 ; i < size; i++){ int idx = word[i] - 'a' ; if (copy->child[idx] == NULL ){ copy->child[idx] = new trieNode(); } copy = copy->child[idx]; } copy->word = word; return ; } }; class Solution { public : /** * @param board: A list of lists of character * @param words: A list of string ...