terminal
Elevo
/
ESC
Login
Initiate Registration
code
Topics
corporate_fare
Companies
history
History
arrow_back
Back to Challenges
#14
Longest Common Prefix
Easy
Acceptance 0%
Editorial
description
Problem Description
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 `""`.
checklist
Constraints
1 <= strs.length <= 200
0 <= strs[i].length <= 200
strs[i] consists of only lowercase English letters.
science
Examples
Case #1
In:
strs = ["flower","flow","flight"]
Out:
"fl"
Case #2
In:
strs = ["dog","racecar","car"]
Out:
""
Mastery Tags
Strings
Hiring Companies
Adobe
Amazon
Google
code
Integrated IDE
Python 3
expand_more
C
C++ 17
Java
JavaScript
Python 3
C
C++ 17
Java
JavaScript
Python 3
refresh
class Solution: def longestCommonPrefix(self, strs: list[str]) -> str: # Write your solution here pass
Login to Compile
Processing
terminal
Debug Output
home
Home
extension
Practice
robot_2
login
Sign In
account_circle
Menu
code_blocks
Coding
psychology
Aptitude
Navigation
close
Login
Registration