Longest Common Prefix

Easy
StringTrieAdobeAmazon
Given a list of lowercase strings, print their longest common prefix. Print `EMPTY` if there is no common prefix. Input format: - First line: n - Next n lines: one string per line

Constraints

1 <= n <= 10^4
0 <= string length <= 200

Sample tests

Sample 1

Sample 2

Sign in to submit