Skip to content

Latest commit

 

History

History
11 lines (8 loc) · 345 Bytes

File metadata and controls

11 lines (8 loc) · 345 Bytes

Problem 5: Consensus Prefix (Longest Common Prefix)

Problem Statement

Write a function to find the longest common prefix string amongst an array of strings. If there is no common prefix, return an empty string "".

Input Format

  • An array of strings strs.

Example

Input: strs = ["flower", "flow", "flight"]
Output: "fl"