How to approach this problem
Please help me with this
@aryan hey, you can use trie here, what you can do is for all nodes of the trie , we calculate number of strings in the substree and then just apply combinatorics such -
NC2(total nodes in the subtree of current nodes)-summation of NC2(children in each nodes)
After finding the strings for each node’s subtree. After that what to do, can you please explain it again
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.