problemscpp
A collection of my answers to algorithm problems in c++.
静态 Public 成员函数 | 所有成员列表
leetcode::concatenated_words::Solution类 参考

#include <leetcode.h>

静态 Public 成员函数

static vector< string > findAllConcatenatedWordsInADict (vector< string > &)
 

详细描述

在文件 leetcode.h74 行定义.

成员函数说明

◆ findAllConcatenatedWordsInADict()

vector< string > leetcode::concatenated_words::Solution::findAllConcatenatedWordsInADict ( vector< string > &  words)
static

在文件 leetcode.cpp44 行定义.

44 {
45 sort(words.begin(), words.end(), [&](const string &a, const string &b) { return a.size() < b.size(); });
46 auto ans = vector<string>();
47 auto node = TrieNode(0);
48 for(const string &word: words) {
49 if(word.length() == 0) {
50 continue;
51 }
52 if(node.dfs(&node, word, 0, false)) {
53 ans.push_back(word);
54 } else {
55 node.insert(word);
56 }
57 }
58 return ans;
59 }
字典树节点
Definition: templates.h:9

被这些函数引用 leetcode::concatenated_words::TEST().


该类的文档由以下文件生成: