Skip to main content
Longest Common Prefix | AlgoCracked
AlgoCracked
ProblemsLongest Common Prefix
Easy42.0% acceptance
StringTrie

Longest Common Prefix

Given an array of strings strs , return the longest string that is a prefix of every entry. If the strings share no common starting characters, return the empty string . Input format Input is [strs] where strs is an array of strings, e.g. [[ flower , flow , flight ]] .

Loading workspace…