Skip to content

Instantly share code, notes, and snippets.

class trienode{
public:
int sum;
vector<trienode*>children;
trienode():sum(0),children(26){}
trienode(int val):sum(val),children(26){}
~trienode(){
for(int i=0;i<26;i++){
if(children[i]) delete children[i];
children[i]=nullptr;