Skip to content
Veltoryx Technologies
ProProblem 11● EasyLeetCode #14 ↗2 min readUpdated 30 October 2026

Longest Common Prefix

Find the longest start shared by every word by reading the words column by column until one differs.

01The problem

Given an array of words strs, return the longest prefix (start) that all of them share, or "" if there is none.

InputOutput
["flower", "flow", "flight"]"fl"
["dog", "racecar", "car"]""

Loading the rest of the lesson…