LeetCode OJ
Problems
Pick One!
Submissions
Sign up
Sign in
Longest Common Prefix
AC Rate: 203/721
My Submissions
Write a function to find the longest common prefix string amongst an array of strings.
C++
Java
class Solution { public: string longestCommonPrefix(vector<string> &strs) { // Start typing your C/C++ solution below // DO NOT write int main() function } };
public class Solution { public String longestCommonPrefix(String[] strs) { // Start typing your Java solution below // DO NOT write main() function } }
Submit Solution
You have not signed in, cannot submit your code.
Send Feedback