S
All challenges
Practice
Home
Blog
Practice
Examples
Feedback
Longest Common Prefix using Trie
00:00
Start
00:00
Sign in
Problem
Hints
3
Solution
History
Easy
Trie
String
Google
Amazon
Find the longest common prefix of all strings in an array using a Trie data structure.
Examples
Example 1
Input →
['flower','flow','flight']
Output →
'fl'
Example 2
Input →
['dog','racecar','car']
Output →
''
Example 3
Input →
['interview','interrupt','internal']
Output →
'inter'
JavaScript
Python
Java (Coming soon)
C (Coming soon)
C++ (Coming soon)
Reset
Run
Submit
Cases
Results