Friday, 1 May 2020

longest common prefix (leetcode) java implementation

Hi Lets solve the Leet code problem "Longest Common Prefix"

Problem :

        we were given an array of string  we should return the Longest common prefix

 Input: ["flower","flow","flight"]
Output: "fl
here the largest matching prefix is fl
Code:
Test Cases:

if you have any query or suggestion please feel free to post a comment

No comments:

Post a Comment