Unique prefix array

sir why my code giving wrong output.

you were updating count wrong way!, first move to the child node and then increment it.
Also while printing j<=i as for unique prefix your last char should have 1 count.


link for your updated code.