Longest Common Prefix

How to proceed this problem using Trie ?

Keep on inserting in a trie and maintain the maximum value up to which all have been the same.

Can you explain me by just giving an example ??

Let’s say we insert the following {flower, flow, flight}

1. f - l - o - w - e - r - end    (answer = 6)
2. f - l - o - w - e - r - end    (answer = 4, as there are more than one children of 'w')
                    \
                     end
3. f - l - o - w - e - r - end    (answer = 2, as there are more than one children of 'l')
        \           \
          \          end
           i - g - h - t - end