Snippets Collections
void print(TrieNode* root, string t,vector<string>& s ){
        int cnt_nulls = 0;
        for(int i = 0; i < 26; i++){
            if(root->v[i] != NULL){
                char c = (i + 'a');
                // cout << c << endl;
                t.push_back(c);
                print(root->v[i] , t, s);
                t.pop_back();
            }
            else cnt_nulls++;
        }
        if(cnt_nulls == 26)
            s.push_back(t);
    }
star

Sat Jun 24 2023 05:07:28 GMT+0000 (Coordinated Universal Time) https://practice.geeksforgeeks.org/problems/prefix-match-with-other-strings/1

#dfs #c++ #print_trie

Save snippets that work with our extensions

Available in the Chrome Web Store Get Firefox Add-on Get VS Code extension