Skip to content

[FEATURE REQUEST] <Longest Common Prefix> #4630

@Mochoye

Description

@Mochoye

What would you like to Propose?

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

Issue details

Longest Common Prefix

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: strs = ["flower","flow","flight"]
Output: "fl"

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions