14. Longest Common Prefix
Practice Longest Common Prefix for free on NudgeCode: Easy, Array & Hash Table pattern. Write it in Python or JavaScript, run the tests in your browser, and ask for a hint when you are stuck.
Return the longest string that every word in strs starts with. If the words share no starting characters, return "".
Example
strs = ["flower","flow","flight"] -> "fl"
Constraints
- 1 <= strs.length <= 200
- 0 <= strs[i].length <= 200
strs[i]contains only lowercase English letters