I want c++ implementation of unique prefix array if you can provide
Unique prefix aray
Hey to solve the question you need to use a trie. At every node store the frequency of visit, then for each string find the node nearest to root with frequency 1. That would be unique prefix for the string.
You can take help of this but try to implement it yourself first.
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.