sir why my code giving wrong output.
Unique prefix array
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.