Unique Prefix Array Problem

My code is showing error and I am not able to remove this error. Please Help!!

hello @avijuneja2007
image

a) after this while loop value of n will always be zero.

b) u have not stored all strings in ur program,so later u cannot access them to find prefixes.

declare an array of string and store all strings there.
instead of using while loop use for loop as this will not modify ur n.

Can you please modify my code. I am not able to make changes.

check ur corrected code here ->

1 Like

Thanks for the help!