Skip to main content

Command Palette

Search for a command to run...

Longest Common Prefix

Published
โ€ข1 min readโ€ขView as Markdown

๐Ÿง  Problem

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 "".


๐Ÿท๏ธ Tags

String


๐Ÿ“Š Difficulty

Easy

โœ… Success Rate: 39.3%
๐Ÿ“ฅ Submissions: 3,891,029
๐Ÿ“ˆ Accepted: 1,529,495


โค๏ธ Reactions

๐Ÿ‘ Likes: 7636
๐Ÿ‘Ž Dislikes: 2930


๐Ÿ’ก Hints


๐Ÿ” Similar Questions

More from this blog

ReStart LeetCode

540 posts