Unique preix array


please correct the code of unique prefix array

sir can you explain what we are doing in this function UniquePrefixArray(string str,string &out)

basically, for each point it is checking whether current character is an already present as a child of trie so far or not, if not then make this a child and break that this is the longest prefix for it